I have
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void getData();
private:
Ui::MainWindow *ui;
Dialog *second;
};
and
class Dialog: public QDialog {
Q_OBJECT
public:
explicit Dialog(QWidget *parent = 0); QDialog * dialog;
QPushButton *pushButton;
QPushButton *pushButton_2;
};
and I can connect pushbuttons in class Dialog with function getData() in class MainWindow (Dialog is a child of class Mainwindow)
I tried
connect(*second->pushButton, SIGNAL(clicked()), this,
SLOT(getData()));
but I got
error: no matching function for call to
‘MainWindow::connect(QPushButton&, const char [11], MainWindow* const, const char [11])’
How do i connect them?