Visual Studio 2010, QT and intellisense / highlight error

I have a problem with VisualStudio 2010 and the QT5 plugin, it seems that VisualStudio does not recognize the QT library (even though I installed the plugin and followed the whole procedure).

This is what I see: https://www.dropbox.com/s/yyzvfev0zoj8x9n/visualstrudel.jpg

So the IDE is highlighting the QT stuff as if the files were missing and Intellisense isn't working. But, if I compile the application, it compiles without error and works like a charm.

What could be causing the highlight / intellisense issue?

+3


source to share


2 answers


You cannot launch Visual Studio 2010 directly.

You will need to run the QT 5.0.1 command line for desktop (MSVC 2010) from Program Files-> Qt 5.0.1-> 5.0.1



After that, you will need to run vcvarsall.bat and devenv after.

x:\program files(x86)\Microsoft Visual Studio 10.0.\VC\vcvarsall.bat
x:\program files(x86)\Microsoft Visual Studio 10.0.\Common7\IDE\devenv.exe

      

+5


source


This applies to VS2012 and Qt4.5.0 , although I believe the Qt version is irrelevant. I'm not sure if this is the same / similar to VS2010, but I came across this post while looking at the same question for VS2012.

Here's what you can do:

  • Right click on the project in your solution and select Properties .
  • Select Configuration Properties โ†’ Catalogs VC ++ .
  • Change Include directories .
  • Add $ (QTDIR) \ include \ QtCore and any other (required by your project) Qt folders to the list (this depends on which Qt headers you are using).
  • This has to be done for every project in your solution using Qt, unfortunately.


Now there is one more note: We pushed our solution from VS2005 to VS2012 and I got this problem when I converted the 2005-> 2012 solution BEFORE setting the QTDIR environment variable . When I re-converted the solution again (the variable was created AFTER * QTDIR *), the problem did not appear. So make sure you have this variable before opening / converting your solution the first time.

Based on a previous post, I believe that some of the information related to the problem is stored in one of the following files: .sdf and / or .v11.suo , So closing VS, deleting those files and opening VS again might help. Just re-import them before you do - I haven't tried it myself (I just re-imported the entire solution that re-generated these files).

+2


source







All Articles