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. Qt Creator Clang Code Model problems collection
QtWS25 Last Chance

Qt Creator Clang Code Model problems collection

Scheduled Pinned Locked Moved Qt Creator and other tools
qt creatorclang
36 Posts 17 Posters 18.5k 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.
  • aha_1980A aha_1980

    Hi all,

    I've created this topic to track all problems that are SOLVED by deactivating the Clang Code Model with Help > About Plugins > Clang Code Model.

    I regularly see these, and like to collect them to make the developers aware of these problems. After all, the build in code model will be removed some time in the future and till then Clang needs to be rock stable and fast.

    So please, add a comment here whenever you encounter a topic that is just SOLVED by disabling Clang.

    Thanks!

    https://forum.qt.io/topic/97461/auto-complete-suggestion-not-work-in-signal-qt-creator-4-8
    https://forum.qt.io/topic/100756/qt-creator-ctrl-left-click-does-nothing-when-using-custom-kit
    https://forum.qt.io/topic/100408/qt-creator-strange-behaviour-how-to-fix-it
    https://forum.qt.io/topic/101095/strange-behavior-with-qt-creator-4-8-1-editor-and-coding-syntax
    https://forum.qt.io/topic/102266/autocomplete-on-a-hello-world-basic-project-doesn-t-works
    https://forum.qt.io/topic/102869/qtcreator-4-9-0-no-semantic-highlighting-with-clang-code-model
    https://forum.qt.io/topic/102999/strange-variable-has-incomplete-type-and-forward-declaration-of-qapplication-issues
    https://forum.qt.io/topic/103065/how-to-parse-symbols-in-qt-creator-4-9-0/
    https://forum.qt.io/topic/106945/problem-with-serial-port-opening/14
    https://forum.qt.io/topic/107181/lot-of-errors-but-it-builds-and-runs-successfully
    https://forum.qt.io/topic/107498/code-completion-is-not-working-in-qtcreator
    https://forum.qt.io/topic/109246/fatal-error-type_traits-file-not-found

    K Offline
    K Offline
    koahnig
    wrote on last edited by
    #2

    @aha_1980

    That is certainly a good idea, but would this not fit better with jira?
    Or are you considering this more like a pre-screening before jira is overloaded?

    Vote the answer(s) that helped you to solve your issue(s)

    aha_1980A 1 Reply Last reply
    2
    • K koahnig

      @aha_1980

      That is certainly a good idea, but would this not fit better with jira?
      Or are you considering this more like a pre-screening before jira is overloaded?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #3

      @koahnig Absolutely ACK to both points.

      I just like to have a collection/polling first, before creating a JIRA ticket.

      And of course that makes it easier for most people here to help ;)

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      3
      • aha_1980A aha_1980

        Hi all,

        I've created this topic to track all problems that are SOLVED by deactivating the Clang Code Model with Help > About Plugins > Clang Code Model.

        I regularly see these, and like to collect them to make the developers aware of these problems. After all, the build in code model will be removed some time in the future and till then Clang needs to be rock stable and fast.

        So please, add a comment here whenever you encounter a topic that is just SOLVED by disabling Clang.

        Thanks!

        https://forum.qt.io/topic/97461/auto-complete-suggestion-not-work-in-signal-qt-creator-4-8
        https://forum.qt.io/topic/100756/qt-creator-ctrl-left-click-does-nothing-when-using-custom-kit
        https://forum.qt.io/topic/100408/qt-creator-strange-behaviour-how-to-fix-it
        https://forum.qt.io/topic/101095/strange-behavior-with-qt-creator-4-8-1-editor-and-coding-syntax
        https://forum.qt.io/topic/102266/autocomplete-on-a-hello-world-basic-project-doesn-t-works
        https://forum.qt.io/topic/102869/qtcreator-4-9-0-no-semantic-highlighting-with-clang-code-model
        https://forum.qt.io/topic/102999/strange-variable-has-incomplete-type-and-forward-declaration-of-qapplication-issues
        https://forum.qt.io/topic/103065/how-to-parse-symbols-in-qt-creator-4-9-0/
        https://forum.qt.io/topic/106945/problem-with-serial-port-opening/14
        https://forum.qt.io/topic/107181/lot-of-errors-but-it-builds-and-runs-successfully
        https://forum.qt.io/topic/107498/code-completion-is-not-working-in-qtcreator
        https://forum.qt.io/topic/109246/fatal-error-type_traits-file-not-found

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

        @aha_1980
        ohho, where to start ?

        Let me list the 2 major ones, why I turned the plugin of by default on my working pc.

        1. speed
        • Classes with large line count ( could thousand < 15000 in my case ) Slow down horribly. Auto complete, ctrl-left-click etc can take up about 30 secs to happen. -> Meanwhile Clang backend process takes up 1 core to 100% load (noticed on a 2016 iMac) - Completely disappears with a deactivation of the plugin
        1. Auto complete is worse with the new code model
        • Especially noticeable during QObject::connect writing. In the old model, writing a &would call forth the auto complete of the correct class name - connect(this, &...) - where as with the new model all included classes are listed
        • The new code model also does not differentiate between signals and slot during the auto complete, and simply lists everything

        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.

        K 1 Reply Last reply
        6
        • J.HilkJ J.Hilk

          @aha_1980
          ohho, where to start ?

          Let me list the 2 major ones, why I turned the plugin of by default on my working pc.

          1. speed
          • Classes with large line count ( could thousand < 15000 in my case ) Slow down horribly. Auto complete, ctrl-left-click etc can take up about 30 secs to happen. -> Meanwhile Clang backend process takes up 1 core to 100% load (noticed on a 2016 iMac) - Completely disappears with a deactivation of the plugin
          1. Auto complete is worse with the new code model
          • Especially noticeable during QObject::connect writing. In the old model, writing a &would call forth the auto complete of the correct class name - connect(this, &...) - where as with the new model all included classes are listed
          • The new code model also does not differentiate between signals and slot during the auto complete, and simply lists everything
          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #5

          @J.Hilk @aha_1980

          Speed and blocked cores are certainly a problem.

          Therefore, it would be handy to have a fast switch for the code model. Basically a definable key stroke for de- and activation would be great. If there a time limit for either settings would be wonderful.
          Or is the key stroke already possible with some macro?

          Vote the answer(s) that helped you to solve your issue(s)

          aha_1980A 1 Reply Last reply
          0
          • K koahnig

            @J.Hilk @aha_1980

            Speed and blocked cores are certainly a problem.

            Therefore, it would be handy to have a fast switch for the code model. Basically a definable key stroke for de- and activation would be great. If there a time limit for either settings would be wonderful.
            Or is the key stroke already possible with some macro?

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @koahnig

            I've already created QTCREATORBUG-21407 for that, so please comment and vote there.

            For me, that would really be helpful as I have some projects that definitely not work with Clang.

            My other observation is, that Clang overall works better and faster on Linux than in Windows. However, with every Creator update some of my projects break in one or another use case and it's no fun finding the reason for that again and again.

            Qt has to stay free or it will die.

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

              One more for the list, turning clang code model off helped here as well

              https://forum.qt.io/topic/100408/qt-creator-strange-behaviour-how-to-fix-it/10


              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
              • rudagR Offline
                rudagR Offline
                rudag
                wrote on last edited by
                #8

                I had the same problem as this one:

                https://forum.qt.io/topic/74385/qt-creator-autocomplete-not-updating-for-new-ui-widgets-until-re-compile/4

                And I solved it by turning clang code model off.

                aha_1980A 1 Reply Last reply
                1
                • rudagR rudag

                  I had the same problem as this one:

                  https://forum.qt.io/topic/74385/qt-creator-autocomplete-not-updating-for-new-ui-widgets-until-re-compile/4

                  And I solved it by turning clang code model off.

                  aha_1980A Offline
                  aha_1980A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  Hi @rudag, thanks for your comment.

                  I think this specific bug has been fixed recently. Which version did you try?

                  Qt has to stay free or it will die.

                  rudagR 1 Reply Last reply
                  0
                  • aha_1980A aha_1980

                    Hi @rudag, thanks for your comment.

                    I think this specific bug has been fixed recently. Which version did you try?

                    rudagR Offline
                    rudagR Offline
                    rudag
                    wrote on last edited by
                    #10

                    @aha_1980

                    4.8.2 (4.8.0)
                    I just updated Qt Creator

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      Maxxii
                      wrote on last edited by
                      #11

                      I had issue with autocompetion of inherited function parameters here:
                      https://forum.qt.io/topic/101748/autocompletion-doesn-t-suggest-function-parameters-inherited-from-parent-class

                      And it is solved by turning off clang code model.

                      aha_1980A 1 Reply Last reply
                      0
                      • M Maxxii

                        I had issue with autocompetion of inherited function parameters here:
                        https://forum.qt.io/topic/101748/autocompletion-doesn-t-suggest-function-parameters-inherited-from-parent-class

                        And it is solved by turning off clang code model.

                        aha_1980A Offline
                        aha_1980A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        Hi @Maxxii,

                        thanks for adding your problem here. I think your specific problem can be turned in a report at bugreports.qt.io - as we already have a reproducible example. Would you mind doing that? (and adding a link here?)

                        Thanks!

                        Qt has to stay free or it will die.

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          Maxxii
                          wrote on last edited by
                          #13

                          @aha_1980 Actually, I made a bug report even before making that thread ;) And then decided to ask on forums to be sure. It's here. I also added comment to this bug, noticing it is solved by turning off clang code model.

                          1 Reply Last reply
                          1
                          • aha_1980A Offline
                            aha_1980A Offline
                            aha_1980
                            Lifetime Qt Champion
                            wrote on last edited by
                            #14

                            https://forum.qt.io/topic/102198/many-incomprehensible-errors looks like another candidate...

                            Qt has to stay free or it will die.

                            1 Reply Last reply
                            0
                            • aha_1980A Offline
                              aha_1980A Offline
                              aha_1980
                              Lifetime Qt Champion
                              wrote on last edited by
                              #15

                              https://forum.qt.io/topic/102266/autocomplete-on-a-hello-world-basic-project-doesn-t-works/4

                              Qt has to stay free or it will die.

                              1 Reply Last reply
                              0
                              • aha_1980A Offline
                                aha_1980A Offline
                                aha_1980
                                Lifetime Qt Champion
                                wrote on last edited by
                                #16

                                https://forum.qt.io/topic/102272/using-qt-project-code-with-earlier-versions/10 also looks like a candidate

                                Qt has to stay free or it will die.

                                1 Reply Last reply
                                0
                                • aha_1980A Offline
                                  aha_1980A Offline
                                  aha_1980
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #17

                                  And another one: https://forum.qt.io/topic/102999/strange-variable-has-incomplete-type-and-forward-declaration-of-qapplication-issues

                                  Qt has to stay free or it will die.

                                  J.HilkJ 1 Reply Last reply
                                  0
                                  • aha_1980A Offline
                                    aha_1980A Offline
                                    aha_1980
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #18

                                    And one more: https://forum.qt.io/topic/103006/linux-qtcreator-and-qt5-9-6-compiling-gnu-c-libraries

                                    Qt has to stay free or it will die.

                                    1 Reply Last reply
                                    0
                                    • aha_1980A aha_1980

                                      And another one: https://forum.qt.io/topic/102999/strange-variable-has-incomplete-type-and-forward-declaration-of-qapplication-issues

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

                                      @aha_1980

                                      And another one: https://forum.qt.io/topic/102999/strange-variable-has-incomplete-type-and-forward-declaration-of-qapplication-issues

                                      oh! I run into that as well, didn't think about turning off the code model as potential solution.

                                      I ended up forwarding a class instance pointer several levels up in the hierarchy ....

                                      This is stupid.


                                      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.

                                      aha_1980A 1 Reply Last reply
                                      1
                                      • J.HilkJ J.Hilk

                                        @aha_1980

                                        And another one: https://forum.qt.io/topic/102999/strange-variable-has-incomplete-type-and-forward-declaration-of-qapplication-issues

                                        oh! I run into that as well, didn't think about turning off the code model as potential solution.

                                        I ended up forwarding a class instance pointer several levels up in the hierarchy ....

                                        This is stupid.

                                        aha_1980A Offline
                                        aha_1980A Offline
                                        aha_1980
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #20

                                        Hi @J.Hilk,

                                        oh! I run into that as well, didn't think about turning off the code model as potential solution.

                                        Well I don't think turning off the code model is a solution. But most of these problems collected here have in common, that Clang has parse problems in a header which then propagate in every file that is including the header.

                                        Tracking down these problems, however, is a tedious task.

                                        Qt has to stay free or it will die.

                                        1 Reply Last reply
                                        0
                                        • aha_1980A Offline
                                          aha_1980A Offline
                                          aha_1980
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #21

                                          https://forum.qt.io/topic/103030/qt-creator-4-9-0-can-t-disable-line-annotations-ignores-option

                                          Qt has to stay free or it will die.

                                          aha_1980A 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