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

slot and signal arguments incompatible?



  • Error was

    F:\Qt\5.15.0\mingw81_32\include\QtCore\qglobal.h:121: error: static assertion failed: Signal and slot arguments are not compatible.

    define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)

    canvas.h

    signals:
        void moreTracksAdded();
    

    Window.h

        void updateSetTrackSpeedLengthMenu();
    

    In window.cpp it has a Canvas Object called drawingSurface
    Window.cpp

    connect(drawingSurface, &Canvas::moreTracksAdded, this, SLOT (updateSetTrackSpeedLengthMenu()));
    


  • @jkwok678

    connect(drawingSurface, &Canvas::moreTracksAdded, this, SLOT (updateSetTrackSpeedLengthMenu()));
    

    I don't know whether it's the cause of your error, but you are using new-style syntax for the signal and old-style syntax for the slot. Don't do that, make them both new-style, maybe that's all your problem is, there probably isn't an overload accepting yours.


Log in to reply