Qt Code:
  1. class Lines : public QMainWindow {
  2. Q_OBJECT
  3. public:
  4. Lines(QWidget *parent = NULL);
  5. ~Lines();
  6. QWidget *widget_main;};
  7.  
  8. Lines::Lines(QWidget *parent) : QMainWindow ( parent ){
  9. ui.setupUi(this);
  10. widget_main = new QWidget(ui.centralwidget);
  11. Dummy d(this);
  12. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. class Dummy : public QMainWindow {
  2. Q_OBJECT
  3. public:
  4. QPushButton *pushButton;
  5. explicit Dummy(Lines *parent = 0);
  6.  
  7. public slots: void slot_pushButton(); };
  8.  
  9. Dummy::Dummy(Lines *parent) : QMainWindow(parent){
  10. pushButton = new QPushButton(parent->widget_main);
  11. connect(pushButton, SIGNAL(clicked()), this->parent(), SLOT(slot_pushButton()));
  12. }
  13.  
  14. void Dummy::slot_pushButton(){
  15.  
  16. pushButton->hide();
  17.  
  18.  
  19. }
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