Use of custom classes

When a custom class is used as a member variable of another class, the required constructor may not be available, and the constructor needs to be overloaded;
Test :: Test (QObject * parent): QObject (parent)
{
}
Classes such as: Take the database as a parameter, you can pass in the parameters of the constructor (cannot be used as a member of the class),
or you can rewrite an init function (can be used
as a member of the class ); you can also use the pointer of the class as a member variable;

Published 7 original articles · Likes0 · Visits10

Guess you like

Origin blog.csdn.net/weixin_45661658/article/details/105656558