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
Forum Updated to NodeBB v4.3 + New Features

QCoreApplication::aboutToQuit is not a signal

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
31 Posts 10 Posters 8.0k Views 4 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.
  • 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
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #21

                You should read the documentation of the suggested arg overload before opening a report.

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

                SPlattenS 1 Reply Last reply
                2
                • K KoneTaH

                  @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 Offline
                  SPlattenS Offline
                  SPlatten
                  wrote on last edited by
                  #22

                  @KoneTaH they are static const char*, the prefix:

                  m = member
                  s = static
                  c = const
                  sz = null terminated string

                  clsJSON is the name of the class they belong to. I tried using the multi-arg version, its just not right. As I said, regardless of the message the code works and does exactly what I intended.

                  Kind Regards,
                  Sy

                  1 Reply Last reply
                  -1
                  • SGaistS SGaist

                    You should read the documentation of the suggested arg overload before opening a report.

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

                    @SGaist I have and I'm using the multi-arg version elsewhere in my code.

                    Kind Regards,
                    Sy

                    JonBJ 1 Reply Last reply
                    0
                    • SPlattenS SPlatten

                      @SGaist I have and I'm using the multi-arg version elsewhere in my code.

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

                      @SPlatten
                      If you want to know why you are getting this warning, I suggest that https://www.kdab.com/uncovering-32-qt-best-practices-compile-time-clazy/, 29. qstring-arg, is giving you the answer:

                      Detects chained QString::arg() calls which should be replaced by the multi-arg overload to save memory allocations.

                          QString("%1 %2").arg(a).arg(b); // Bad
                          QString("%1 %2").arg(a, b); // one less temporary heap allocation
                      

                      As @KoneTaH noted

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

                      SPlattenS 1 Reply Last reply
                      2
                      • JonBJ JonB

                        @SPlatten
                        If you want to know why you are getting this warning, I suggest that https://www.kdab.com/uncovering-32-qt-best-practices-compile-time-clazy/, 29. qstring-arg, is giving you the answer:

                        Detects chained QString::arg() calls which should be replaced by the multi-arg overload to save memory allocations.

                            QString("%1 %2").arg(a).arg(b); // Bad
                            QString("%1 %2").arg(a, b); // one less temporary heap allocation
                        

                        As @KoneTaH noted

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

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

                        @JonB , the problem with:

                        QString("%1 %2").arg(a, b);
                        

                        Is that the arguments for arg depend on the types being passed, there are 22 overloaded versions, here's the first:
                        (Screenshot 2021-01-15 at 07.39.49.png

                        Kind Regards,
                        Sy

                        jsulmJ 1 Reply Last reply
                        0
                        • SPlattenS SPlatten

                          @JonB , the problem with:

                          QString("%1 %2").arg(a, b);
                          

                          Is that the arguments for arg depend on the types being passed, there are 22 overloaded versions, here's the first:
                          (Screenshot 2021-01-15 at 07.39.49.png

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by jsulm
                          #26

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

                          Is that the arguments for arg depend on the types being passed, there are 22 overloaded versions, here's the first:

                          This is wrong. What others are talking about is: https://doc.qt.io/qt-5/qstring.html#arg-22
                          Which is a template with arbitrary number of parameters and types. The only requirements is:
                          "Args can consist of anything that implicitly converts to QString, QStringView or QLatin1String.".

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          3
                          • Z Offline
                            Z Offline
                            Zetrick
                            wrote on last edited by
                            #27

                            SPlatten,

                            I am getting these same errors now as well. Did you ever find a solution?

                            Thanks.

                            SPlattenS 1 Reply Last reply
                            0
                            • Z Zetrick

                              SPlatten,

                              I am getting these same errors now as well. Did you ever find a solution?

                              Thanks.

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

                              @Zetrick , No, it still does it, I've reported the bugs.

                              Kind Regards,
                              Sy

                              1 Reply Last reply
                              0
                              • J Offline
                                J Offline
                                Justinxiang
                                wrote on last edited by
                                #29

                                SPlatten,
                                I'm writing this code:

                                connect(set_Btn,&QPushButton::clicked,this,&Shudu::showQipan);
                                

                                and the qt creator also brings a prob that says:

                                QAbstractButton::clicked is not a signal [clazy-connect-non-signal]
                                

                                do u have and idea or it's the same problem you have?

                                SPlattenS 1 Reply Last reply
                                0
                                • J Justinxiang

                                  SPlatten,
                                  I'm writing this code:

                                  connect(set_Btn,&QPushButton::clicked,this,&Shudu::showQipan);
                                  

                                  and the qt creator also brings a prob that says:

                                  QAbstractButton::clicked is not a signal [clazy-connect-non-signal]
                                  

                                  do u have and idea or it's the same problem you have?

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

                                  @Justinxiang , its a rubbish message, there are lots of issues like this where signals that are signals are reported as not being signals...check the headers and documentation you will see that your code is ok.

                                  Kind Regards,
                                  Sy

                                  1 Reply Last reply
                                  0
                                  • J.HilkJ Offline
                                    J.HilkJ Offline
                                    J.Hilk
                                    Moderators
                                    wrote on last edited by
                                    #31

                                    I disabled the check, because it drove me nuts :D
                                    cac4d1e7-4071-48d8-95d0-40947ae69cd8-image.png

                                    seems to be a MacOS problem only, doesn't happen in the same project on my Windows VM


                                    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.

                                    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