- All (478)
- jom (0)
- Qt Linguist (7)
- Qt Eclipse Integration (9)
- Qt Designer (7)
- Qt Creator (4)
- Qt build system: qmake (31)
- Qt build system: configure (3)
- Qt Assistant (5)
- Printing (4)
- Porting from Qt 3 to Qt 4 (1)
- Plugins (7)
- Qt Visual Studio AddIn (2)
- Qt/MFC Migration (2)
- QtScript (3)
- MDI (2)
- XML (1)
- Widgets (22)
- WebKit (5)
- Tools and Containers (2)
- Threads (2)
- Text Handling (10)
- SQL (6)
- QtTest (1)
- QtService (1)
- Platform: Windows (49)
- Platform: Unix (16)
- Platform: Mac OS X (18)
- Image Formats (2)
- I/O (2)
- Graphicsview (8)
- Font handling (9)
- Event System (18)
- Drag and Drop (4)
- Dialogs (6)
- Desktop integration (3)
- ActiveQt (3)
- Itemviews (60)
- Layout (4)
- Qt Quick (10)
- Qt SDK (1)
- Licensing (2)
- Platform: Embedded Linux (38)
- Painting (32)
- OpenGL (4)
- Object Model (6)
- Network (5)
- Multimedia (3)
- Miscellanous (23)
- Main Window (19)
- Look and Feel (23)
- Development (0)
- Getting Involved (0)
- Routines (0)
Intellisense does not work for my Qt application. What's wrong?
When writing code that uses the class generated from a ui file, the
intellisense does not appear to list the functions for it.
There are several reason why this happens:
1. You are currently in the function body in a slot. The VS intellisense
parser gets confused by the slot keyword in the header file and stops
therefore working. As an easy workarround for this just place a ‘;’ behind the
slots declaration, e.g.:
public slots:;
- void mySlot();
2. The class/struct is not directly included. Sometimes the completion on e.g.
a push button object does not work since you included
it’s of course perfect, but intellisense may not work correctly with this
information. Try to include
3. The C++ source code has not been generated yet. Intellisense works only on
C++ code, but when designing a form there is no C++ code directly involved.
The C++ code is generated by uic which must be run after the ui file is saved.
So, whenever you added or removed an item from the form you have to run uic on
it. This can easily be done by opening the context menu for the ui file in the
solution explorer and clicking on compile. Another, more comfortable, way of
doing this is enabling the AutoRunUic property in Tools|Options|Qt|General
options page. This basically saves the form and runs uic whenever you leave
the form editor.
4. Make sure you open Visual Studio using the command prompt provided with Qt
in the Start menu if you are using the binary package or from a command prompt
that has the environment set correctly if you are using the source package.
If it’s only happening with a specific project, then try deleting (or
renaming to be safe) the .ncb and .suo file for that project. These will be
regenerated when the project is opened and built, respectively, and could help
if the problem is due to some sort of corruption in those files.

2 comments
August 21, 2010
Robot Herder
It would be good to have such tips for Qt creator too
September 2, 2011
Lab Rat
I have a similar problem. For the most part the intellisense works. I have all the include and project settings as far as I know. But for some reason it does not work on any QPainter objects. Why is this?
I am using VS2008 Professional on Windows 7 with the Qt Addin.
Solved it: U need to add the specific folders to your VC++ Include directory. I added C:\\Qt4.70\\include\\QtGui and intellisense worked for QPainter and QBrush.
Just adding C:\\Qt4.70\\include does not guarentee recursion into the below folders…. as I would have assumed.