View Single Post
Posts: 190 | Thanked: 129 times | Joined on Mar 2010 @ Bavaria, Germany
#14
Originally Posted by saxen View Post
so in constructor method i've to define:

className(parameters, QObject parent);

am i right?
Not sure what you mean.

example implementation code:
Code:
MyClass::MyClass(QObject* parent)
: QObject(parent) // Not passing the parent to the QObject base will also result in memory leakage
{
    mySubObject = new QObject(this); // Will be deleted when "MyClass" dies
    myLeakObject = new QObject; // Will live forever
}