QT in VS2010
-
Hi I try to implement QT in VS2010. Therefor I installed the Qt libraries 4.8.2 for Windows (VS 2010, 234 MB) and Qt Visual Studio Add-in. I put the to Path D:\Qt\4.8.2\bin and created the QTDIR Variable. If I start a QT project like the hello world everything works .
Now my question: if I start a new empty c++ projekt i can´t include the QT headers like qstring. What can I do? I think one way would be to add the directories in the project-properties (i´m not sure which one) but this seems to be not the best way because then I have to change the project properties for every new project. Are there ways to set general properties to have the QT headers when i need them. For example iostream i can include every time i want to and the same I would like to have for the QT stuff.
THX
Schubi
-
What did you choose when opening a new project?
There should be an entry for new Qt4 projects. It basically provides similar choices as when creating new C++ projects. If you like to have a Qt project, you need to create such as Qt project. It will also allow you to choose what need (e.g. Network lib, etc) of Qt. -
if i do it the way you wrote it works fine. But I want to make a normal c++ programm an empty projekt for example to build a dll or somethink like that. I only want to use some parts of QT like the QString or parts of the Databaseclases.
-
Well, there is also an entry for Qt based libs. There you can start writing your own libs.
Note, that you are creating only a project with a template. For instance the main project will hold an instance of QApplication or QCoreApplication. However, you can easily remove those statements if you do not need. If you throw everything of Qt out of main, it should basically the same as with non-Qt templates, only the path for Qt and other settings are readily available.