简体   繁体   中英

When using Qt in VS2008, IntelliSense does not work properly

I use Qt 4.4.2 in Visual Studio 2008.

When I am writing code, IntelliSense seems to die - it does not show any methods or data members in Qt objects such as QPushButton, does not see the QObject::connect static method, etc.

Is it a typical situation or did I do something wrong while installing the library?

Most likely non-standard extensions like public slots: etc.

There's already a FAQ at the Qt site: Intellisense does not work for my Qt application. What's wrong?

You need to tell Intellisense about the QT include directories. This can be found by going to Tools -> Options -> Projects and Solutions -> VC++ Directories. Add them to the Show Directories for: Include Files list on the right. I don't know if the QT installation does this by default or not.

Also, make sure that your VS Project files have the QT include directories as part of the Additional Include Directories under C/C++ General settings. (Although you probably have this already if you can successfully compile).

For me, the problem was solved by deleting the solution's.ncb file, then rebuilding to regenerate it. After that the intellisense worked.

Switch to VisualAssist. It is the must anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM