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. Not a signal or slot declaration: ??
Forum Updated to NodeBB v4.3 + New Features

Not a signal or slot declaration: ??

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 767 Views 2 Watching
  • 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    What am I doing wrong ( this time ) ?

    Here is the complaint

    /mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.h:130: Error: Not a signal or slot declaration

    and here is the source of the error

    public slots:
    void static SCANStarted(void);

    Hope it is not the "static" keyword messing things up.
    Requested by compiler for yet unknown reason - hopefully not the source of he error and to be investigated lalter.
    Cheers

    ,,,just the facts ma'am..

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      a slot can not be static.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      A 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        a slot can not be static.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @Christian-Ehrlicher said in Not a signal or slot declaration: ??:

        a slot can not be static.

        hence how do I fix this ?

        /mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.cpp:34: error: invalid use of non-static member function ‘void MainWindow_SUB_FT857::SCANStarted()’
        /mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.cpp: In constructor ‘MainWindow_SUB_FT857::MainWindow_SUB_FT857(QWidget*)’:
        /mnt/sde5/QT_PROGRAMS_FULL/MDI_BT/MDI_BT/SUB_FT857/mainwindow_sub_ft857.cpp:34:60: error: invalid use of non-static member function ‘void MainWindow_SUB_FT857::SCANStarted()’
        34 | connect(watcher, &QFutureWatcher<int>::started, this, SCANStarted);
        | ^~~~~~~~~~~

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          29490e0b-f399-473f-840b-9ba33a722872-image.png

          ??

          JonBJ M 2 Replies Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Use e.g. a lambda - already told and shown you multiple times.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0
            • A Anonymous_Banned275

              29490e0b-f399-473f-840b-9ba33a722872-image.png

              ??

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @AnneRanch
              Depends what class this is and what class the SCANStarted slot is in.

              Maybe @Christian-Ehrlicher already knows those, I don't.

              1 Reply Last reply
              0
              • A Anonymous_Banned275

                29490e0b-f399-473f-840b-9ba33a722872-image.png

                ??

                M Offline
                M Offline
                mchinand
                wrote on last edited by
                #7

                Your connect statement should be (add the class to the slot):

                connect(watcher, &QFutureWatcher<int>::started, this, &MainWindow_SUB_FT857::SCANStarted);
                
                1 Reply Last reply
                0

                • Login

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