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:
in.
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 <
#include <
#include <
#include < QtGui> change to include < QtWidgets> code>.
Read More:
- Qt Failed opening project “xxx“: No plugin can open project type “text/plain“
- The. Exe crashed program ends abnormally when the QT project is copied to the new environment
- Vs QT project ‘fatal error C1083:’ failed to open include file
- QT encountered in CentOS installation( qt.qpa.plugin : Could not load the Qt platform plugin “xcb” )
- QT learning 3: configuration and testing of QT creator 2.4.1 development environment
- QGIS uses qt4.6.3 to upgrade to the version compiled by qt4.8.3
- WSL start QT error qt.qpa.xcb : could not connect to display :0.0
- Compiling QT project under vs encountered “error 89error msb6006:“ cmd.exe ”Exited with code 3
- [pit filling] problem summary of upgrading VS2010 project to vs2017
- Can not start, can not find QT pligins “windows” problem after installing QT vs environment 2021-06-13
- QT creator error: C1083: unable to open include file: “qmediaplayer”
- Error: lnk1168. Unable to open e::: language ⁃ project3 ⁃ debug ⁃ project3.exe for writing
- Compile QT source code error causes and Solutions
- The web project removal server reports an error, and the web project in eclipse cannot be automatically deployed to Tomcat
- Error in the project tag in the POM file of Maven project: failure to transfer
- [unable to read project file xxxxx, XXX failed to load project file, name cannot start with “<" character (hex value 0x3c)] exception handling method
- android studio Error Gradle project sync failed. Please fix your project and try again
- Project read error when downloading Maven project
- MySQL driver compiling method of QT under windows and solutions to abnormal errors
- Solutions to various inexplicable errors after QT compilation