It's possible to configure Qt Quick 4.7.3 / QML Development using Microsoft Visual Studio C++ 2008 Express project.Quick Start
TARGET =
DEPENDPATH += .
INCLUDEPATH += .# Input
SOURCES += YourApp.cppYou need to update this .pro Qt project file when you add source or header files.A simple YourApp.cpp would be: #include <QApplication>
#include <QPushButton> int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world");
hello.resize(100, 30); hello.show();
return app.exec();
}You can see how this simple Qt GUI application looks on the screenshot. How to Add Qt Quick / QML SupportTo support QML / Qt Quick, add to .pro file:QT += gui declarativeCreate the .qml file :import QtQuick 1.0 Rectangle { width: 100; height: 100; color: "red" }Then load the .qml file from the main .cpp : #include <QApplication>
#include <QPushButton>
#include <QDeclarativeView>int main(int argc, char *argv[])
{
QApplication app(argc, argv); QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("qmlvs.qml"));
view.show(); return app.exec();
}You can see how this QML / Qt Quick application looks on the screenshot.What about Visual Studio 2010?It's possible but you'll have to download Qt sources and
build using Visual Studio compiler which can take 3 hours or more.Download / Clone Sample Projects from Git RepositoryTo make it easy for you, the sample projects are freely available as Apache Licensed open source projects in my Nokia Developer Projects Git repository: https://projects.developer.nokia.com/qmlexperimentsLearning Resources
- Install Microsoft Visual Studio C++ 2008 (Express)
- Install Qt Library 4.7.x for Visual C++ 2008
- Set environment QTDIR to C:\Qt\4.7.x
- Create a new Makefile project
- For Debug, set the build command as: qmake && nmake
Set the Debug launch command as: debug\YourApp.exe - For Release, set the build command as: qmake && nmake release-all
Set the Release launch command as: release\YourApp.exe - Add a YourApp.cpp file
- Create initial Qt .pro project file by running: qmake -project
TARGET =
DEPENDPATH += .
INCLUDEPATH += .# Input
SOURCES += YourApp.cppYou need to update this .pro Qt project file when you add source or header files.A simple YourApp.cpp would be: #include <QApplication>
#include <QPushButton> int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world");
hello.resize(100, 30); hello.show();
return app.exec();
}You can see how this simple Qt GUI application looks on the screenshot. How to Add Qt Quick / QML SupportTo support QML / Qt Quick, add to .pro file:QT += gui declarativeCreate the .qml file :import QtQuick 1.0 Rectangle { width: 100; height: 100; color: "red" }Then load the .qml file from the main .cpp : #include <QApplication>
#include <QPushButton>
#include <QDeclarativeView>int main(int argc, char *argv[])
{
QApplication app(argc, argv); QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("qmlvs.qml"));
view.show(); return app.exec();
}You can see how this QML / Qt Quick application looks on the screenshot.What about Visual Studio 2010?It's possible but you'll have to download Qt sources and
build using Visual Studio compiler which can take 3 hours or more.Download / Clone Sample Projects from Git RepositoryTo make it easy for you, the sample projects are freely available as Apache Licensed open source projects in my Nokia Developer Projects Git repository: https://projects.developer.nokia.com/qmlexperimentsLearning Resources
To get started on Qt GUI / Qt Quick Development on desktop and mobile devices, check out these recommended books:
- C++ GUI Programming with Qt 4 (2nd Edition) - Prentice Hall
- Beginning Nokia Apps Development: Qt and HTML5 for Symbian and MeeGo
- Foundations of Qt Development
- Advanced Qt Programming: Creating Great Software with C++ and Qt 4