Regression?

Sebastian Sauer mail at dipe.org
Thu Feb 7 03:26:16 CET 2008


btw the Qt way (through it works only if it's a QObject);

class A : public QObject
{
};

class B
{
    public:
        A* a;
};

int main(int argc, char **argv)
{
     /* setup the instances */
     B* b = new B();
     b->a = new A();
     QPointer<A> a2 = b->a;

     /* do what setLayout(0) was doing */
     delete b->a;
     b->a = 0; /* not really needed, but well, can't harm */

     /* now it's NULL since QPointer takes care to set it to NULL by catching 
the destroyed() signal and setting the a2-pointer to NULL.
     delete a2;
}


More information about the Panel-devel mailing list