Would I get the same same result if the instance of A&C were inside of B?
IE
A&C -> signals -> B
B -> signals -> D (the object that created B) to delete it.
but A and C are new instances of those classes created in B.
kind of like:
//...
signals:
//...
B() { a= new A(); b=new B(); connect(AtoB); connect(CtoB);}
signals:
void sigB(int);
public slots:
void slotB
(QObject *o
){ emit sigB
(m_list.
indexOf(o
));
} };
//...
public slots:
};
//...
public:
D() { b = new B(); connect(B to D);}
public slots:
DSlot() { delete b or deletelater b}
};
class A : public QObject{
//...
signals:
void sigA(QObject *);};
class B : public QObject{
//...
B() { a= new A(); b=new B(); connect(AtoB); connect(CtoB);}
signals:
void sigB(int);
public slots:
void slotB(QObject *o){ emit sigB(m_list.indexOf(o)); }
};
class C : public QObject {
//...
public slots:
void slotC(QObject *o){...}
};
class D : public QObject {
//...
public:
D() { b = new B(); connect(B to D);}
public slots:
DSlot() { delete b or deletelater b}
};
To copy to clipboard, switch view to plain text mode
and B initiates a call to the D Slot which deletes it and its children.
Bookmarks