Now I got stuck by using your way of solving the problem:
3 Classes (A non-Qt, a small QObject class and a QDialog)... Idea is that the non-Qt class can report something to the dialog by using signals.
This is the small QObject class which should create a signal and call a slot in the dialog class.
class ControllerDialog
: public QObject {
public:
ControllerDialog(DialogRobot *dlgRobot);
public slots:
void sendSocketReceived() {
emit socketReceived();
}
signals:
void socketReceived(){};
private:
DialogRobot *dlg;
};
class ControllerDialog : public QObject {
public:
ControllerDialog(DialogRobot *dlgRobot);
public slots:
void sendSocketReceived() {
emit socketReceived();
}
signals:
void socketReceived(){};
private:
DialogRobot *dlg;
};
To copy to clipboard, switch view to plain text mode
Here is the snippet of the connection, placed (quick&dirty) within the ControllerDialog Constructor:
QObject::connect(this,
SIGNAL(socketReceived
()),
dlgRobot, SLOT(robotSocketComplete()));
QObject::connect(this, SIGNAL(socketReceived()),
dlgRobot, SLOT(robotSocketComplete()));
To copy to clipboard, switch view to plain text mode
And this is the part of the QDialog:
public slots:
void on_btnStart_clicked();
void on_btnFinished_clicked();
void robotSocketComplete() { ... }
public slots:
void on_btnStart_clicked();
void on_btnFinished_clicked();
void robotSocketComplete() { ... }
To copy to clipboard, switch view to plain text mode
Problem is that connect() reports
Object::connect: No such signal QObject::socketReceived() in src/draw/Qt/controller/controller_dialog.cpp:12
Object::connect: (receiver name: 'DialogRobotClass')
I used the search function of the forum and googled now for quite a while... And I found several HowTo's etc., but I don't see any bigger difference between my code and the samples
I used connect() successfully for connecting Button-Events etc., but in this case I don't see the problem
Bookmarks