Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. slot and signal arguments incompatible?
Forum Updated to NodeBB v4.3 + New Features

slot and signal arguments incompatible?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jkwok678
    wrote on last edited by
    #1

    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()));
    
    JonBJ 1 Reply Last reply
    0
    • J jkwok678

      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()));
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @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.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved