QT5 and QT4, there are a lot of changes and differences, you can refer to: changes from QT4 to QT5.
I am a computer installed Qt5.9.1, running in the c + + GUI Qt4 programming (second edition) with some problems happened when source program, this article will introduce how to upgrade to Qt5 Qt4 engineering, and run in the new version of the Qt Creator.
in the c + + GUI Qt4 programming (second edition) programs in the second chapter gotocell2 as an example, the original project directory contains the following five files:
and then open the gotocell2 pro file, Qt Creator will start to appear the interface for the following.
ick Configure Project to enter the Project configuration screen. In the General box, check Shadow Build, and then modify the Build Directory to suit your needs. Then click the Run button in the left toolbar.
Note: Neither the project file path nor the Build path can contain Chinese characters.
run as a result of an error, cannot find the relevant header files:
solution is pro file begins with the following two lines of code:
QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
If you run it again, it will return an error. Because the change to the.pro file you just made requires a qmake to take effect.
In the project directory navigation window, select the project root folder ->; Right click – & gt; The Run qmake. Rerun it, and you get the desired result.
Because this project is relatively simple, the module used is few, so just modify the. Pro file can be. However, if the project is large and uses more functional modules, more modifications may be needed to run the program correctly.
#include < QtGui> change to
include < QtWidgets> code>.
- QT learning 3: configuration and testing of QT creator 2.4.1 development environment
- OpenGL Programming Guide 8th Edition 9th Edition vs2015 vs2017 configuration method
- Compile QT source code error causes and Solutions
- Win10 vs 2017 prompt cannot open include file: “windows. H”: no such file or director
- Configuration, compilation and installation of vtk8.1 in qt5.9
- Using Visual Studio 2015 to create. DLL and use. DLL
- Configuration and use of qt5.9.6 and vs2015
- Configuring OpenGL in Chinese version of VS2010 and problem solving
- Vs2012 compiling PCL dependency library vtk7.0
- Installation of Ubuntu + VTK
- Environment configuration at the beginning of OpenCV + vs2015
- Vtk8.2.0 (32bit + 64bit) compilation and installation test (win10 + vs2017 + Qt5)
- Configuring OpenGL in Code:: blocks
- Syntax error, insert “Finally” to complete TryStatem in Myeclipse in Java-
- Linux QT download / usr / include / C + + / 7/ cstdlib:75 : 15: fatal error: stdlib. H: no such file or directory error
- Clion MinGW super fast configuration OpenGL development environment
- Problems in compiling VTK with cmake: solutions to error configuration process, project files may be invalid
- [VTK] vtk8.2.0 + vs2015 + win10 compilation and configuration
- Vs2017 compiles pcl1.8.1 with vtk8.0 and uses qt5.9.5
- How to solve the error after Java importing project