Note that there are some explanatory texts on larger screens.

plurals
  1. POQt push button event using Qt Designer not working: "No such slot QApplication"
    primarykey
    data
    text
    <p>I've read several articles about push button events in Qt but none seem to solve my problem. I have a simple GUI built with Qt Designer which only contains one button. The run-time error I get is the following:</p> <p>Object::connect: No such slot QApplication::FullSizeR() in CameraWindow.h:25 Object::connect: (sender name: 'FullSize') Object::connect: (receiver name: 'CameraViewer')</p> <p>FullSizeR() is the function I want called when My button is pushed.</p> <p>Here's' how main is defined:</p> <pre><code>int main(int argc, char *argv[]) { // initialize resources, if needed // Q_INIT_RESOURCE(resfile); QApplication app(argc, argv); CameraWindow cw; cw.show(); //app.setActiveWindow(&amp;cw); //cw.getData(); // this paints the window return app.exec(); } </code></pre> <p>And this is how CameraWindow is defined:</p> <pre><code>class CameraWindow : public QDialog{ Q_OBJECT public: bool serverConnected; void getData(); CameraWindow() { widget.setupUi(this); //this calls Qt Designer code //the function bellow produces a run-time error //access the button via widget.FullSize connect(widget.FullSize,SIGNAL(clicked()), qApp, SLOT(FullSizeR())); } QLabel *imgl; virtual ~CameraWindow(); protected slots: void FullSizeR(); private: Ui::CameraWindow widget; }; </code></pre> <p>I've properly included QObject and my function definition under 'slots' This is the definition of FullSizeR:</p> <pre><code>void CameraWindow::FullSizeR() { QMessageBox::information(this,"Button clicked!\n", "Warning"); } </code></pre> <p>The above doesn't seem to be hard to solve. I know its something simple if I only knew Qt a bit better :-/</p> <p>Thanks All</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload