Introduction to QT and how to configure QT using VS2010 for development
Qt is a god horse thing.
qt– a cross-platform application and UI development framework
It includes Cross-platform class libraries, integrated development tools, and Cross-platform Ides. With Qt You can deploy these applications across different desktops and embedded operating systems without having to rewrite the source code in a one-time development application.
Qt is primarily developed and maintained by Nokia. QT authorizes QT through open source authorization (LGPL and GPL) as well as commercial authorization. QT is famous in Linux, Linux's KDE graphical interface is based on QT development.
QT's biggest advantage is cross-platform, you can see above, QT can support Windows,mac os,linux,embedded Linux, Wince/mobile,symbian, Nokia's newest Megoo that's not a cinch, Because the company recently some projects require cross-platform support, the original GIS engine is based on Windows development, although not with MFC, but because the drawing engine this block uses GDI +, so cross-platform is very difficult. So in order to support Cross-platform and cross-platform requirements across the foreseeable future, we decided to refactor the drawing engine on QT and develop a map project management application based on the Qtgis engine using QT.
I will be synchronizing the steps to develop this application in my blog, hopefully through this series of blogs, to showcase the convenience of QT development applications and the power to showcase our company's GIS engine. The source code for the application will be synchronized in each tutorial to provide the download. The GIS engine will be easy to learn and develop by providing an SDK.
First article. Configure QT's Windows development environment and develop it through VS2010.
1. Download qt installation package and VS2010 qt plugin, you can go to the following address for download (the following download is based on Windows, if the other environment of the operating system can be downloaded here). Qt sdk:http://qt.nokia.com/downloads/sdk-windows-cpp
VS2010 Development plugin: http://qt.nokia.com/downloads/visual-studio-add-in
2. Install QT SDK
Installation is actually very simple, basically all the way back, the main is to pay attention to the installation path of QT is best installed in all English path and no space in the middle, after installation, you can run the Start menu Qt Demo, intuitive feeling under the powerful function of QT.
The interface is cool.
3. Install QT vs Development Plugin
As with the QT SDK installation, you can return along the way, after installation on the VS2010 added a menu qt, as shown in the picture
4. Compiling QT
QT is compiled by default using MinGW, and if you want to use VS2010 development, you need to recompile QT.
Go to Start menu Microsoft Visual Studio 2010,visual Studio tools,visual Studio Command Prompt (2010), you need to be aware that this must be the use of Visual studio C Ommand Prompt (2010), cannot use CMD's DOS window
After entering QT's installation directory, perform CD qt and go into Qt's root directory
Run command configure-platform win32-msvc2010,o (select opensource mode) carriage return, Y (agree license) carriage return
Then will automatically configure the QT compilation environment, and so on after the configuration, run NMAKE, enter, QT will start a lengthy compilation process, this period of time is very long, need more than 4 hours, we can sleep at night when the compile.
5. Configure VS2010 QT Development environment (VS2010 is best in English version, QT may not support VS2010 Chinese version)
When the QT is compiled, you can configure the VS2010 development environment, enter the VS2010, select Qt menu, qt option, and go to the following image interface
Click Add, add qt installation directory, and take the name, I use QT's discovery version is the most name, select OK.
6. New or imported QT project
You can create a new QT project in VS2010
To import QT Pro Project
Pro is Qt's own compiler QT creator Project project file, if you want to use VS2010 development, you need to import the original project pro into the VS2010 project file, you can use the menu Qt-open
So our QT development environment is set up, we can example and demo under the QT directory of the operation of the example to see again, experience the powerful and convenient QT, Enjoy.
Reproduced
Guyue
2014-7-24