QT configuration in VS2013

I. Introduction

   Anyone who knows a little bit about programming generally knows that VS2013 is a very good integrated development environment, and QT5 is a free and easy-to-use graphics library. Of course, if you can use QT5 for graphical interface development in VS2013, it is undoubtedly A rather enjoyable thing to do.

  However, if you want to integrate QT in VS2013, this is by no means a simple matter for beginners in programming. Even many veterans are a bit at a loss, and they have blindly conducted a lot of tests, but they still can't get the point.

  So, how can we integrate QT5 in VS2013 for GUI application development? Next, I will introduce it to you in four chapters: the download of the relevant installation package, the installation of the relevant installation package, the configuration of the QT project, and the common problems and solutions. The outline of this article is as follows:

1png.png

Two related installation package download

2.1 VS2013 download

   Needless to say, Microsoft's famous integrated development environment, all friends with a little programming foundation should know how to download and install it. Here, the installation package, secret key and Visual Assistant (programming assistant) in the Baidu cloud network disk are provided:

   Link: https://pan.baidu.com/s/1b1hf_jX7xElHrVDp6Zx0QQ Password: xg6n

2.2 Qt5.7.1 installation package download

   Contains the corresponding QT library and Qt integrated development environment (ie QtCreator).

2.png

Download URL: ①QT official website: https://www.qt.io/ ②Baidu cloud network disk link: https://pan.baidu.com/s/1rWZ6G2YMwEu2qMntRND9JQ Password: qoa7

③If you really don't understand the download process, please refer to: https://jingyan.baidu.com/article/9f63fb91859ec7c8400f0ef4.html

2.3 QT VS plugin - download of qt-vs-addin-1.2.5

3.png

  Whether you choose 32-bit Qt or 64-bit Qt, plugins can use the files in the image above.

Download path: ①Qt official website: https://www.qt.io/ ②Baidu cloud network disk link: https://pan.baidu.com/s/1r-kKSXn1T-j9hhAEVESz6g Password: qai6

Installation of three related installation packages

   After the above installation package is downloaded to the local computer, the installation of the installation package is followed.

   First, you need to install Qt5.7.1, then install the Qt-VS plugin, and finally start VS2013 for configuration. In this chapter, I will introduce the points that need attention one by one.

3.1 Install Qt5.7.1

   Double-click to start Qt5.7.1, and the welcome interface will appear. At this time, just click "Next".

4.png

Then you want to enter your personal information, click "Skip" to skip this step, and then enter the official installation interface, click Next.
5.png

6.png

  Select the installation folder. Note: You should try to choose a folder with more disk space. After the Qt is installed, the volume is still not small, about several G.

7.png

  Click "Next". When setting components, generally keep the default. Some friends may choose all of them. This is really unnecessary. The source components in them are more than 1G, which are usually not used.

8.png

  When it comes to agreeing to the agreement, of course, choose to agree. Start menu shortcut, keep the default. Then, click the "Install" button to start the installation. The installation time is a bit long, please be patient. After that, the installation is complete.

3.2 Install the Qt-VS plugin

   There is nothing special to say about installing the Qt-VS plugin, click the exe file, and keep the default all the way.
9.png

  Of course, the installation path can also be defined arbitrarily. For example, I installed it to the "Qt5VSAddin" folder under D:\ProGrammeFiles. This is very simple, everyone should be able to understand.

10.png

Configuration of four QT projects

   After Qt5.7.1 and the plugin are installed, you can now configure VS2013. When you start VS2013, you will find a "QT5" option on the menu.

11.png

  Click on this menu and select "Qt Options".

12.png

  Click the "Add" button in the upper right corner of the settings window that opens. We need to add the Qt installation path here. When adding it, you need to name the Qt version. Of course, you can choose the name of this version. I chose msvc2013_64, and then click "OK".

13.png

14.png

  Now, it's all done. Let's test it, use VS2013 to open the QT project and run it.

15.png

16.png

  All the way is to click "Next" until the last step "Finish".

  After that, hold down "Ctrl" + "F5" or "Local Windows Debugger" at the same time, and the following window will pop up successfully. This indicates that QT was successfully configured in VS2013. happy~~~~~~

17.png

Five common problems and solutions

5.1 Common problems and solutions

  After configuring according to the above method, if there are many red wavy lines in the program, the solution is as follows:

   Add your Qt/include path to Project->Properties->VC++ Directories->Include Directories. Such as: D:\ProGrammeFiles\QT5.7.1\5.7\msvc2013_64\include Try it yourself, it is very effective.

18.png

5.2 Common problems and solutions

  "This program cannot be started because the computer is missing qt5core.dll" appears in QT.

  When the following occurs in QT:

19.png

  There is no corresponding dynamic library file. At this time, you need to add the path of the dll dynamic library under the Path variable: (The method under the win10 system is provided here).

20.png

21.png

  My QT path: D:\ProGrammeFiles\QT5.7.1\5.7\msvc2013_64\bin and D:\ProGrammeFiles\QT5.7.1\Tools\QtCreator\bin, different installation paths, QT paths are also different, find your installation Path, add the path containing the dll dynamic library file used by QT to the Path variable.

22.png

six postscript

  The above is a review of the frequently used QT installation and configuration process during my master's degree. If there are any shortcomings, please criticize and correct them, and hope to bring you convenience to some extent.

write picture description here
write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326353375&siteId=291194637