Ok, below is the class simplified with the content and structure that is relevant to my issue. All compiles fine and runs only problem I am having is the Signal/Slot issue.
class myWidget
::myWidgetPrivate : public QObject{
Q_OBJECT
public:
myWidgetPrivate(myWidget* p)
: parent(p)
{
userA = new UserData;
connect(userA, SIGNAL(isLoaded()), this, SLOT(onALoaded()));
userB = new UserData;
connect(userB, SIGNAL(isLoaded()), this, SLOT(onBLoaded()));
}
UserData* userA;
UserData* userB;
private slots:
void onALoaded()
{
//Do some stuff with A
}
void onBLoaded()
{
//Do some stuff with B
}
};
#include "myWidget.moc"
myWidget
::myWidget(QWidget *parent
) d( new myWidgetPrivate(this) )
{}
class myWidget::myWidgetPrivate : public QObject
{
Q_OBJECT
public:
myWidgetPrivate(myWidget* p)
: parent(p)
{
userA = new UserData;
connect(userA, SIGNAL(isLoaded()), this, SLOT(onALoaded()));
userB = new UserData;
connect(userB, SIGNAL(isLoaded()), this, SLOT(onBLoaded()));
}
UserData* userA;
UserData* userB;
private slots:
void onALoaded()
{
//Do some stuff with A
}
void onBLoaded()
{
//Do some stuff with B
}
};
#include "myWidget.moc"
myWidget::myWidget(QWidget *parent)
: QWidget( parent ),
d( new myWidgetPrivate(this) )
{}
To copy to clipboard, switch view to plain text mode
Bookmarks