Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QCoreApplication::aboutToQuit is not a signal
QtWS25 Last Chance

QCoreApplication::aboutToQuit is not a signal

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
31 Posts 10 Posters 7.1k 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by SPlatten
    #1

    Yesterday I updated Qt Creator:

    Qt Creator 4.14.0
    Based on Qt 5.15.2
    Built on Dec 17 2020 07:57:30
    

    This morning I re-compiled my project and a bunch of warnings are displayed with a yellow background:

    QCoreApplication::aboutToQuit is not a signal [clazy-connect-non-signal]
    

    The code this appears on:

    QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit , this, &clsModHelper::terminateModule);
    

    So I thought perhaps it has been changed, so I googled and found the documentation:
    https://doc.qt.io/qt-5/qcoreapplication.html#signals
    Which is the latest and current version of the SDK, its still a signal so why the warning?

    When I then looked closed at the context help in Qt Creator when removing a ':' and retyping ':'. It seems that aboutToQuit is now a QPrivateSignal ?

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Did you clean the build folder completely and rebuild it?

      It could be a false positive from clazy.

      SPlattenS 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        Did you clean the build folder completely and rebuild it?

        It could be a false positive from clazy.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #3

        @mrjj , I just did a clean, then Run qmake, then Rebuild.

        Still the same, also there are others in a class I've written clsListener:

            class clsListener;
            typedef std::map<quint16, clsListener*> mpListeners;
        
            class clsListener : public QObject {
            Q_OBJECT
        
            private:
                static mpListeners msmpListeners;
                static quint16 msuint16NextPort;
        
                QTcpSocket* mpClient;
                QTcpServer* mpServer;
                quint16 muint16Port;
        
            public:
                clsListener(quint16 uint16Port, QObject* pParent = nullptr);
                ~clsListener();
        
                static void commonDecode(QAbstractSocket* psckIn);
                static clsListener* pGetListener(quint16 uint16Port);
                QTcpSocket* psckClient() { return mpClient; }
                QTcpServer* psckServer() { return mpServer; }
                static quint16 uint16NextPort() { return ++clsListener::msuint16NextPort; }
                quint16 uint16Port() { return muint16Port; }
        
            signals:
                void newConnection(QTcpSocket& robjClient);
        
            public slots:
                void onAcceptError(QAbstractSocket::SocketError socketError);
                void onDataIn();
                void onErrorOccurred(QAbstractSocket::SocketError socketError);
                void onNewConnection();
            };
        

        Now:

        QObject::connect(mpobjListener, &clsListener::newConnection  ,this, &clsModHelper::onNewConnWithSocket);
        

        The line above also has the same message for the signal newConnection.

        The same is true for other classes including QTimer::timeout:

        QObject::connect(&mstmrWatchdog, &QTimer::timeout, this, &clsModHelper::terminateModule);
        

        Kind Regards,
        Sy

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          hi
          Seems the clazy plugin is a bit confused.
          They are both private signals but that just means user code cannot emit them, not
          that they are not signals at all.
          So seems like you got a new version of clazy and it warns about those privat signals.

          SPlattenS 1 Reply Last reply
          1
          • mrjjM mrjj

            hi
            Seems the clazy plugin is a bit confused.
            They are both private signals but that just means user code cannot emit them, not
            that they are not signals at all.
            So seems like you got a new version of clazy and it warns about those privat signals.

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #5

            @mrjj, thank you, also finding other things along the way which makes me wonder how much testing goes into this before its released? This kind of thing seems pretty fundamental.

            Kind Regards,
            Sy

            JonBJ 1 Reply Last reply
            0
            • SPlattenS SPlatten

              @mrjj, thank you, also finding other things along the way which makes me wonder how much testing goes into this before its released? This kind of thing seems pretty fundamental.

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

              @SPlatten
              Agreed, but why did you just update Qt Creator?? For precisely this reason, why don't you stick with a stable version of Qt Creator/Qt version and stick with them for a quite a while? If you want to update every time there is a new, latest version, this sort of thing happens....

              SPlattenS 1 Reply Last reply
              0
              • JonBJ JonB

                @SPlatten
                Agreed, but why did you just update Qt Creator?? For precisely this reason, why don't you stick with a stable version of Qt Creator/Qt version and stick with them for a quite a while? If you want to update every time there is a new, latest version, this sort of thing happens....

                SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on last edited by
                #7

                @JonB , because I’m a fool

                Kind Regards,
                Sy

                JonBJ 1 Reply Last reply
                0
                • SPlattenS SPlatten

                  @JonB , because I’m a fool

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

                  @SPlatten
                  :) As you please, just saying this leads to these probs! Anyway, either it's a bug in clazy, or delete everything in the build output folder, in case there are "hidden"/other files left lying around after "build clean", which is what I do when I don't think an error is mine, and certainly after installing/upgrading anything.

                  SPlattenS 1 Reply Last reply
                  0
                  • JonBJ JonB

                    @SPlatten
                    :) As you please, just saying this leads to these probs! Anyway, either it's a bug in clazy, or delete everything in the build output folder, in case there are "hidden"/other files left lying around after "build clean", which is what I do when I don't think an error is mine, and certainly after installing/upgrading anything.

                    SPlattenS Offline
                    SPlattenS Offline
                    SPlatten
                    wrote on last edited by
                    #9

                    @JonB , just tried that still exactly the same, did:

                    ls -la
                    

                    then remove everything including hidden files.

                    Kind Regards,
                    Sy

                    JonBJ 1 Reply Last reply
                    0
                    • SPlattenS SPlatten

                      @JonB , just tried that still exactly the same, did:

                      ls -la
                      

                      then remove everything including hidden files.

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

                      @SPlatten
                      The it looks like a (new) clazy issue....

                      SPlattenS 1 Reply Last reply
                      0
                      • JonBJ JonB

                        @SPlatten
                        The it looks like a (new) clazy issue....

                        SPlattenS Offline
                        SPlattenS Offline
                        SPlatten
                        wrote on last edited by
                        #11

                        @JonB , today I uninstalled and re-downloaded Qt and installed again, this installed Qt Creator 4.14 by default with Qt 5.15.2, the same problems are still present in this build.

                        Kind Regards,
                        Sy

                        J.HilkJ 1 Reply Last reply
                        0
                        • SPlattenS SPlatten

                          @JonB , today I uninstalled and re-downloaded Qt and installed again, this installed Qt Creator 4.14 by default with Qt 5.15.2, the same problems are still present in this build.

                          J.HilkJ Offline
                          J.HilkJ Offline
                          J.Hilk
                          Moderators
                          wrote on last edited by
                          #12

                          @SPlatten So I had the same issue where clazy would faulty flag timeout from QTimer as not a signal, which is of course nonsense.

                          But it somehow went away, and I'm not sure what caused it.

                          Try one or both of the following:

                          • Change the kit, it should force a revelation of your code
                          • Close the project, delete the *.pro.user file, and open it again

                          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                          Q: What's that?
                          A: It's blue light.
                          Q: What does it do?
                          A: It turns blue.

                          SPlattenS 1 Reply Last reply
                          0
                          • J.HilkJ J.Hilk

                            @SPlatten So I had the same issue where clazy would faulty flag timeout from QTimer as not a signal, which is of course nonsense.

                            But it somehow went away, and I'm not sure what caused it.

                            Try one or both of the following:

                            • Change the kit, it should force a revelation of your code
                            • Close the project, delete the *.pro.user file, and open it again
                            SPlattenS Offline
                            SPlattenS Offline
                            SPlatten
                            wrote on last edited by
                            #13

                            @J-Hilk , I did just that, deleted build folders, removed all .pro.user.* files then re-setup project build folders and then rebuilt, unfortunately it still does the same.

                            Kind Regards,
                            Sy

                            K 1 Reply Last reply
                            0
                            • SPlattenS SPlatten

                              @J-Hilk , I did just that, deleted build folders, removed all .pro.user.* files then re-setup project build folders and then rebuilt, unfortunately it still does the same.

                              K Offline
                              K Offline
                              KoneTaH
                              wrote on last edited by
                              #14

                              Got the same issue with latest Qt Creator on MacOS (with iOS as project target). Clazy constantly complains about emitting and connecting non-signals - both in my own code as well as with signals from Qt classes like QTimer::timeout and so on. Full clean, rebuild from scratch and so on doesn't help.

                              SPlattenS 1 Reply Last reply
                              0
                              • K KoneTaH

                                Got the same issue with latest Qt Creator on MacOS (with iOS as project target). Clazy constantly complains about emitting and connecting non-signals - both in my own code as well as with signals from Qt classes like QTimer::timeout and so on. Full clean, rebuild from scratch and so on doesn't help.

                                SPlattenS Offline
                                SPlattenS Offline
                                SPlatten
                                wrote on last edited by
                                #15

                                @KoneTaH , I do wonder what the release criteria is before products like Qt Creator are deemed fit for release....as this is quite obvious.

                                Kind Regards,
                                Sy

                                1 Reply Last reply
                                0
                                • E Offline
                                  E Offline
                                  evan_y
                                  wrote on last edited by evan_y
                                  #16

                                  I'm experiencing this as well.

                                  Could it be related to the updated version of clang included with Xcode 12? In addition to updating Qt Creator recently, I also updated Xcode on my machine (macOS 10.15).

                                  Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?

                                  SGaistS 1 Reply Last reply
                                  0
                                  • E evan_y

                                    I'm experiencing this as well.

                                    Could it be related to the updated version of clang included with Xcode 12? In addition to updating Qt Creator recently, I also updated Xcode on my machine (macOS 10.15).

                                    Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?

                                    SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    @evan_y said in QCoreApplication::aboutToQuit is not a signal:

                                    Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?

                                    No, that clang version is for the tooling provided by Qt Creator. Qt is not built with it, only the official Apple released Xcode clang is supported.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    E 1 Reply Last reply
                                    1
                                    • SGaistS SGaist

                                      @evan_y said in QCoreApplication::aboutToQuit is not a signal:

                                      Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?

                                      No, that clang version is for the tooling provided by Qt Creator. Qt is not built with it, only the official Apple released Xcode clang is supported.

                                      E Offline
                                      E Offline
                                      evan_y
                                      wrote on last edited by
                                      #18

                                      @SGaist Good. That is how my environment is set up and how it's supposed to be.

                                      I'm still seeing the behavior reported by the OP.

                                      1 Reply Last reply
                                      0
                                      • SPlattenS Offline
                                        SPlattenS Offline
                                        SPlatten
                                        wrote on last edited by
                                        #19

                                        I've also observed other odd clazy messages:

                                        QString strKey = QString("%1%2").arg(clsJSON::mscszAck).arg(clsJSON::mscszCmdHB);
                                        

                                        Results in:

                                        Use multi-arg instead [clazy-qstring-arg]
                                        

                                        This is clearly rubbish, because the other arguments in .arg are for formatting the same argument and what I have done works perfectly. I've submitted another bug for this tonight.

                                        Kind Regards,
                                        Sy

                                        K 1 Reply Last reply
                                        0
                                        • SPlattenS SPlatten

                                          I've also observed other odd clazy messages:

                                          QString strKey = QString("%1%2").arg(clsJSON::mscszAck).arg(clsJSON::mscszCmdHB);
                                          

                                          Results in:

                                          Use multi-arg instead [clazy-qstring-arg]
                                          

                                          This is clearly rubbish, because the other arguments in .arg are for formatting the same argument and what I have done works perfectly. I've submitted another bug for this tonight.

                                          K Offline
                                          K Offline
                                          KoneTaH
                                          wrote on last edited by
                                          #20

                                          @SPlatten What are the types of those clsJSON::mscszAck and clsJSON::mscszCmdHB? If they are both strings, this clazy warning is probably correct because there are overloads with multiple string arguments:

                                          https://doc.qt.io/qt-5/qstring.html#arg-14

                                          Your code should work perfectly as well, but it may be suboptimal.

                                          SPlattenS 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