[Previous: Creating Qt Translation Files for the Project] [Contents]
Visual Studio can only provide code completion as long as it understands the code. Unfortunately, it does not know how to handle the Qt keyword slots in the header file. This means that the respective function body is foreign to the code model and no code completion will be provided. You can workaround the problem be placing a ';' after the colon of the slots keyword in the class declaration.
Note: Remember to remove the ';' when exporting the project as the code might not with older Unix compilers.
class MyClass {
Q_OBJECT
public slots:;
void doSomething();
...
};
The Visual Studio code model parser only parses C++ sources, meaning that widgets or objects defined in .ui files will not be accessible. To workaround the problem, the Qt Visual Studio integration automatically generates C++ code from the .ui file by saving the file and running uic on it. This step is done everytime the current editor changes, e.g., when switching from the form editor to any source file. This behavior can be switched off by setting the AutoRunUic property in Tools|Options|Qt to false. So, if the code completion does not work, make sure that the AutoRunUic property is set to true. For more information, you can refer to the Modifying Project Properties section.
You should refresh the code model, Intellisense. This is done by opening the solution explorer, invoking the context menu of the project and activating the item Update Intellisense. However, this functionality is only available in Visual Studio 2005 and 2008.
[Previous: Creating Qt Translation Files for the Project] [Contents]
| Copyright © 2008 Trolltech | Trademarks | Qt 1.4 |