Home > Back-end >  In Qt, in a class, use the one in the class, in the QString a variable's value, how to define?
In Qt, in a class, use the one in the class, in the QString a variable's value, how to define?

Time:11-13

Beginners ask next everybody a great god:
In Qt, when hope in a class, use the one in the class, in the QString a variable's value, how to define?
Such as in 1. CPP want to display the interface 2. CPP QString a to the value of this variable,
Thank you

CodePudding user response:

This is the basis of C/C + + language itself,
A.h
 
# pragma once
Class A {
Public:
A () {}
Const int v () {return m_v; }
Void setV (const int v) {m_v=v; }
Protected:
Int m_v=0;
};


B.h
 
# pragma once
Class A;
Class B {
Public:
Void fun (A * pA);
};


The biggest pp
 
# include "B.h
"# include "A.h
"#include
Void B: : fun (A * pA)
{
STD: : cout}