Q_OBJECT
public:
~Lines();
ui.setupUi(this);
widget_main
= new QWidget(ui.
centralwidget);
Dummy d(this);
}
class Lines : public QMainWindow {
Q_OBJECT
public:
Lines(QWidget *parent = NULL);
~Lines();
QWidget *widget_main;};
Lines::Lines(QWidget *parent) : QMainWindow ( parent ){
ui.setupUi(this);
widget_main = new QWidget(ui.centralwidget);
Dummy d(this);
}
To copy to clipboard, switch view to plain text mode
Q_OBJECT
public:
explicit Dummy(Lines *parent = 0);
public slots: void slot_pushButton(); };
connect(pushButton, SIGNAL(clicked()), this->parent(), SLOT(slot_pushButton()));
}
void Dummy::slot_pushButton(){
pushButton->hide();
}
class Dummy : public QMainWindow {
Q_OBJECT
public:
QPushButton *pushButton;
explicit Dummy(Lines *parent = 0);
public slots: void slot_pushButton(); };
Dummy::Dummy(Lines *parent) : QMainWindow(parent){
pushButton = new QPushButton(parent->widget_main);
connect(pushButton, SIGNAL(clicked()), this->parent(), SLOT(slot_pushButton()));
}
void Dummy::slot_pushButton(){
pushButton->hide();
}
To copy to clipboard, switch view to plain text mode
WHatever I do, I never jump into the slot_pushButton()
However, If I declare and define slot_pushButton() in the class Lines it does work,
but this is not what I want. I want to reach the slot_pushButton in the Subclass
Bookmarks