You could use "signal chaining" (connecting a signal to another signal) for achieving this. See the example below:
{
// don't forget this macro whenever you declare
// custom signals and/or slots
Q_OBJECT
public:
// declare a custom signal
signals:
void someButtonClicked();
};
{
// form a connection between the button and the dialog
connect(someButtonInTheDialog, SIGNAL(clicked()), this, SIGNAL(someButtonClicked()));
}
class MyDialog : public QDialog
{
// don't forget this macro whenever you declare
// custom signals and/or slots
Q_OBJECT
public:
MyDialog(QWidget* parent = 0);
// declare a custom signal
signals:
void someButtonClicked();
};
MyDialog::MyDialog(QWidget* parent) : QDialog(parent)
{
// form a connection between the button and the dialog
connect(someButtonInTheDialog, SIGNAL(clicked()), this, SIGNAL(someButtonClicked()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks