Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Prevent codeModel from considering some spaces as Compiler Flags delimiters
Qt 6.12 LTS is out! See what's new in the release blog

Prevent codeModel from considering some spaces as Compiler Flags delimiters

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 624 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.
  • F Offline
    F Offline
    f222
    wrote on last edited by
    #1

    Linked to the issue I mentionned here: https://forum.qt.io/post/831373

    This happens on Windows 11, QtCreator 17.0.0, when compiling Qt5 or Qt6 projects.

    When adding compiler flag using the QMAKE_CXXFLAGS variables they are taken into account by the Code Model but the Code Model seems to always consider spaces as flags delimiters (even when the flag is surrounded by properly escaped double quotes).

    One usecase we have at my workplace is when using the /external:I from MSVC cl or /imsvc from clang-cl instead if using QtCreator INCLUDEPATH variable. We do that to allow the inclusion of an external library without having the compiler generate warning from the library's header files. This works fine unless there is a space in the include path.

    For example if I have QMAKE_CXXFLAGS += /imsvc\"C:/path with spaces /to/include/folder\", the code will compile and run fine but the code model will split this into 4 flags (/imsvc\"C:/path, with, spaces and /to/include/folder\") :
    83e25b37-b4a8-4039-b813-87b596b1db2a-image.png

    This causes the code model to break itself, consider it is setup for CXX98 and generates warning everywhere.

    Is there a way to escape those inner spaces (I tried to put a \ in front of the spaces but it doesn't seem to work) or to declare an external include path using a Qt variable ?

    1 Reply Last reply
    0
    • aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #2
      This post is deleted!
      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
      • Unsolved