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. Strange behavior with Qt Creator 4.8.1 editor and coding syntax
Forum Updated to NodeBB v4.3 + New Features

Strange behavior with Qt Creator 4.8.1 editor and coding syntax

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 3 Posters 3.9k Views 1 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.
  • D Offline
    D Offline
    drmhkelley
    wrote on last edited by
    #1

    I don't think I had this behavior prior to version 4.8.1.

    The Qt Creator editor is (well, used to be) pretty smart about catching syntax errors prior to compilation. However, it appears to no longer as smart as it once was. For example, in prior versions, it was aware of new typedefs and defines from header files. Now, almost every variable is accompanied by a warning about "use of undeclared identifier" for user-defined types.

    For a typical .cpp file, I now have anywhere from 50 to 1000 "Issues" to sift through looking for some small number of real coding problems.

    Has anyone else seen this and have suggestion for what I may have configured incorrectly?

    Everything compiles and debugs fine, but this is a constant annoyance.

    Thanks

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

      Hi,

      Do you still have the same behaviour if you disable the Clang code model plugin ?

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

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Do you still have the same behaviour if you disable the Clang code model plugin ?

        D Offline
        D Offline
        drmhkelley
        wrote on last edited by
        #3

        @SGaist Thanks. Not sure what you mean exactly. Under Options/C++/CodeModel, I see that "the Clang Model is enabled because the corresponding plugin is loaded". I can set the Diagnostic Configuration (several options for Clang, Clang-Tidy, and Clazy), but not sure which of the several would be most appropriate. Tried several and didn't see the symptom go away. Didn't see a way to disable it all.

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

          It's explained in the Parsing C++ Files with the Clang Code Model chapter of Qt Creator's documentation.

          From that page:

          To use the built-in code model instead, select Help > About Plugins > C++, and deselect the ClangCodeModel check box. The changes take effect after you restart Qt Creator.
          

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

          D 1 Reply Last reply
          2
          • SGaistS SGaist

            It's explained in the Parsing C++ Files with the Clang Code Model chapter of Qt Creator's documentation.

            From that page:

            To use the built-in code model instead, select Help > About Plugins > C++, and deselect the ClangCodeModel check box. The changes take effect after you restart Qt Creator.
            
            D Offline
            D Offline
            drmhkelley
            wrote on last edited by
            #5

            @SGaist Thanks. That seems to have eliminated the symptom!!

            But that then raises other questions. What is Clang and why would I want it if it just adds grief? Must be good for something, but can't see what.

            aha_1980A 1 Reply Last reply
            0
            • D drmhkelley

              @SGaist Thanks. That seems to have eliminated the symptom!!

              But that then raises other questions. What is Clang and why would I want it if it just adds grief? Must be good for something, but can't see what.

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

              @drmhkelley said in Strange behavior with Qt Creator 4.8.1 editor and coding syntax:

              But that then raises other questions. What is Clang and why would I want it if it just adds grief? Must be good for something, but can't see what.

              It obviously failed for you, and that is surely not the wanted behavior. Clang is a real compiler that gives more information about your code and supports newer C++ standards than the internal code model could.

              On the other hand, it is very fragile to syntax errors, missing includes etc.

              Have a look here for more information: https://blog.qt.io/blog/2018/06/05/qt-creators-clang-code-model/

              Regards

              Qt has to stay free or it will die.

              D 1 Reply Last reply
              2
              • aha_1980A aha_1980

                @drmhkelley said in Strange behavior with Qt Creator 4.8.1 editor and coding syntax:

                But that then raises other questions. What is Clang and why would I want it if it just adds grief? Must be good for something, but can't see what.

                It obviously failed for you, and that is surely not the wanted behavior. Clang is a real compiler that gives more information about your code and supports newer C++ standards than the internal code model could.

                On the other hand, it is very fragile to syntax errors, missing includes etc.

                Have a look here for more information: https://blog.qt.io/blog/2018/06/05/qt-creators-clang-code-model/

                Regards

                D Offline
                D Offline
                drmhkelley
                wrote on last edited by
                #7

                @aha_1980 Thanks for the pointer - I'll check it out.

                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