Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QObject::connect: Cannot connect (null)::pressed to MainWindow::handleExecutionButton()



  • Hello,
    I get these 2 errors on build and have no idea why:

    QObject::connect: Cannot connect (null)::pressed to MainWindow::handleExecutionButton()
    QObject::connect: Cannot connect (null)::pressed to MainWindow::handleAbortButton()
    

    Here's a snippet of the code where the connect part is:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    Ui_MainWindow *form = new Ui_MainWindow();
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    
    
        QObject::connect(form->startButton, SIGNAL (pressed), SLOT (handleExecutionButton()));
        QObject::connect(form->stopButton, SIGNAL (pressed), this, SLOT (handleAbortButton()));
    }
    

    You are my last hope. Thank you in advance!



  • Hi,

    What is that ???

    Ui_MainWindow *form = new Ui_MainWindow();
    

    try:

    connect(ui->startButton, SIGNAL (pressed()), SLOT (handleExecutionButton()));