Should class A really be able to connect to a private slot in class B?
Here's some pseudo code to illustrate what I mean:
{
A() {
instanceOfB = new B();
connect(this, SIGNAL(mySignal()), instanceOfB, SLOT(MySlot()));
}
signals:
void mySignal();
private:
B* instanceOfB;
}
{
private slots:
void MySlot();
}
class A : public QObject
{
A() {
instanceOfB = new B();
connect(this, SIGNAL(mySignal()), instanceOfB, SLOT(MySlot()));
}
signals:
void mySignal();
private:
B* instanceOfB;
}
class B : public QObject
{
private slots:
void MySlot();
}
To copy to clipboard, switch view to plain text mode
This effectively means that a class B private function can be accessed by class A, which is not really in the spirit of private function access specifier.
Bookmarks