Skip to content

Qt VS Tools will randomly, rarely, completely destroy IntelliSense and render it totally unusable until you successfully compile the affected project #53

@DavidJCobb

Description

@DavidJCobb

Describe the bug
In some cases, Qt VS Tools breaks IntelliSense completely, such that all syntax highlighting within the IDE acts as though the project's C++ language standard is set to C++14 (the default for MSVC). For example, in the following code, the fully-qualified namespace name has a red underline and when hovered over, an error tooltip states "qualified name not allowed," the error message for nested namespace names written via the syntax introduced in C++17:

namespace dovah::loaded_forms {

Project settings are unchanged; my project is meant to use /std:c++latest, for example; a check of the project settings shows that that setting wasn't changed to something else behind my back, and everything except for IntelliSense behaves appropriately given that setting.

"Syntax errors" like these are the most immediately obvious symptom of breakage and the best clue to one of the main things Qt VS Tools is breaking, but these problems also cause cascading problems everywhere; for example, any usage of any identifier declared or defined in a nested namespace will show spurious IntelliSense errors because the namespace declaration itself is not parsed properly. Additionally, it seems as though MSBuild settings for include paths are being broken/overridden as well, such that #include directives break if a project customizes them in any way (e.g. allowing includes to be resolved relative to $(ProjectDir)).

In essence, this bug renders IntelliSense completely unusable, totally breaks nearly all syntax highlighting in the IDE, and makes nearly every line of an affected project show spurious errors.

This bug occurs with no obvious cause, has only ever happened to me when working with projects based on Qt VS Tools, and can only be resolved by successfully compiling the affected project. That fix is massively inconvenient when the bug happens to a project with in-progress code changes, given that it's harder to fix compiler errors in WIP code, etc., when literally every line of code is showing spurious errors in the text editor. Visual Studio's usual commands for refreshing the IntelliSense database (e.g. context menu -> IntelliSense -> Restart IntelliSense) have no effect on this bug.

To Reproduce
Unknown.

Expected behavior
Qt VS Tools should not completely break IntelliSense in every way possible; this is generally undesirable and should be avoided

Screenshots
Spurious include errors: the project is set to permit include paths relative to $(ProjectDir), but these paths fail to resolve when this bug is occurring.
Image

Spurious namespace declaration errors: the project is set to use /std:c++latest, but namespaces declared with C++17 syntax show spurious errors when this bug is occurring.
Image

Desktop (please complete the following information):

  • Qt VS Tool Version 3.4.1
  • Visual Studio 2026 Community, v18.3.1 Stable

I've had this happen as far back as VS2022. It occurs rarely but has been a problem for years. I searched through some old notes I have and found records of me complaining about this happening from March 2024. I don't know offhand what range of Qt VS Tools versions those dates map to.

Additional context
It's hard to track down precisely how Qt VS Tools modifies the C++ language standard, much less how it overrides it so forcibly that all of my project settings are rendered moot for IntelliSense. However, I see that here, there's an MSBuild props file internal to Qt VS Tools that sets the language standard based on a variable, Qt_STDCPP_. The value for that variable appears to be set up here by a "defaults" props file. These variables appear to be written to a generated props file here.

This bug is happening to me right now, and looking at my build output directory, I see that there's a $(ProjectDir)\x64\Debug\qmake\qtvars_x64_Debug.props file produced as part of Qt VS Tools' build process. Right now, inside of that file, I see <Qt_STDCPP_></Qt_STDCPP_>. So for some reason, Qt VS Tools is failing to fill in a C++ language version (such that it defaults to C++14), doing a design-time build, failing to clean up after itself, and therefore annihilating IntelliSense.

The bug is not specific to any one project; I've had multiple relatively large Qt-based programs be hit by this at one point or another.

The bug does not, itself, interfere with compilation of an affected project. Only IntelliSense is ruined.

I've made a copy of that /x64/Debug/ folder, as well as copies of my project's vcxproj file, and can provide those if needed. The project as a whole is currently private though. For now, I'm going to recompile my project and try to get back to work on it, so hopefully in a few minutes I won't be able to poke and prod at this bug anymore, at least until it strikes again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions