Integrate the qt5.2 environment to build vs2010

Source: Internet
Author: User

After using QT for so long, IDE has always been using Vs and creator (the actual development is dominated by vs). For which one is better, I will not express my views here, but it also has its own strengths and varies from person to person, each has its own love.

The qt5 version was upgraded from 4.8 to 5.1 long after it was released. Now that 5.2 is released, we will try it out first. In addition, someone has been asking me about Vs and QT integration, and I will record it here... Environment: vs2010 + qt5.2We will not elaborate on the download and installation of vs here. 1. Download The qt5.2 installation package (QT-Windows-opensource) and QT plug-in (Visual Studio add-in)
  • Qt5.2, QT plug-in: http://qt-project.org/downloads.

Qt5.2 can also be downloaded here: http://download.qt-project.org/official_releases/qt/5.2/5.2.0.

Find the corresponding version for download, which contains a variety of different versions. msvc2010 and msvc2012 respectively refer to the QT versions that support vs2010 and vs2012, while the difference between OpenGL and non-OpenGL is whether OpenGL is supported, android and IoS are QT versions that support Android and iOS platforms respectively. The selected version (marked) is as follows:
  • Qt-windows-opensource-5.2.0-msvc2010_opengl-x86-offline.exe (OpenGL Version)
  • Visual Studio add-in 1.2.2 For qt5
Ii. InstallationThe installation sequence of QT-Windows-opensource and Visual Studio add-in is not required. The installation process is no longer required (silly-next). The installation path should not contain Chinese characters, spaces, or special characters (~ <> |? * [Email protected] # $ % ^ &:,;). After Visual Studio add-in is installed, corresponding QT options will appear in! 3. Configure the development environment
  • Choose qt5> QT Options> Add to configure the development environment of.

Select your QT installation path. The path is D: \ Software \ QT \ qt5.2.0 \ 5.2.0 \ msvc2010_opengl. Note:4.8.3 is my previous version, because I may install many different versions (assuming that there are many problems with the new version and I don't want to use it any more, what should I do ?). Select the version you want to use: If you select version 4.8.3, you must download a New Visual Studio add-in for qt4 plug-in ( Principles:Version ). After completing the preceding configurations, You can import or create a new QT project. Import the qt pro project
  • Choose qt5-> open QT project file (. Pro )...

Create a QT Project
  • Choose File> New> Project> qt5 projects> QT application, enter the project name, and click Next.
As follows:
  • Select the dependent module: the most basic modules such as qtcore, qtgui, and qtwidgets include audio/video, network, database, XML, and OpenGL. You can directly select the required modules.
  • After that, you can run it!
    • Select: Debug-> start execution or Ctrl + F5.
    As follows:
  • Add Environment VariablesFind the executable program in the project directory and run it directly. *. dll is lost. As follows:
  • Solution:(1) Right-click computer> Properties> advanced system Settings> advanced> environment variables and add the environment variable path: D: \ Software \ QT \ qt5.2.0 \ 5.2.0 \ msvc2010_opengl \ bin. (2) find the missing * in the installation directory of QT *. DLL (D: \ Software \ QT \ qt5.2.0 \ 5.2.0 \ msvc2010_opengl \ bin) and put it in the same directory as the executable program.Recommended:Since there are many QT programs, if every program executes method 2, the workload can be imagined, so we recommend using method 1.

Reprinted from: http://blog.sina.com.cn/s/blog_a6fb6cc90101gynd.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.