1

Header File

class QFrame;
class QPushButton;
class QLineEdit;
class QLabel;
class livecontroller;
class liveview : public QWidget
{
Q_OBJECT
public:
explicit liveview(QWidget *parent = 0);
QString getUsername();
QString getPassword();
void setController_live(livecontroller* c);
QFrame *frame_3;


public slots:
void button_1x1_clicked();
void button_2x2_clicked();

.cpp file

/* Constructor code */

connect(pushButton_1x1, SIGNAL(clicked()), this, SLOT(button_1x1_clicked()));
connect(pushButton_2x2, SIGNAL(clicked()), this, SLOT(button_2x2_clicked()));


centralwidget->setLayout(horizontalLayout);
live_window->setCentralWidget(centralwidget);

live_window->setWindowTitle("Live View");
live_window->show();
}
void liveview::button_1x1_clicked()
{
qDebug() << "1 x 1";
Livecontroller->video_layout();
}
void liveview::button_2x2_clicked()
{
Livecontroller->video_layout();
}

I tried running qmake but nothing happened. button_1x1_clicked() function never get called. I am running qt 5.7 on ubuntu 16.04.

Mitesh Patel
  • 465
  • 2
  • 5
  • 14
  • where are your `pushButton_1x1` etc. declared? You also should use the new syntax for connecting like shown here: http://doc.qt.io/qt-5/signalsandslots.html this may give you some better indication if there is some error during compilation – Hayt Oct 18 '16 at 07:57
  • I have declared pushbuttons in header and created objects in constructor. I forgot to add that code. I also have included header. – Mitesh Patel Oct 18 '16 at 08:01
  • I tried debugging. I got this warning. RTTI symbol not found for class 'QObject' – Mitesh Patel Oct 18 '16 at 08:07
  • 2
    it would help if you could provide a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). This makes it easier for others to help you as they can immediately reproduce the problem and it might also help you narrow down the problem. – Erik Oct 18 '16 at 08:09
  • @MiteshPatel as I said try the modern syntax of the signals and slots. Also you have your header posted in the question and I don't see them there. But instead you have other not important things there. You should clean up your code to the minimum where it is reproducable and then show everything. – Hayt Oct 18 '16 at 08:12
  • @Hayt thank I will go for modern syntax. – Mitesh Patel Oct 18 '16 at 08:34
  • This should help: http://stackoverflow.com/questions/26422154/my-signal-slot-connection-does-not-work – Silicomancer Oct 21 '16 at 21:48

0 Answers0