Table of contents
One: download URL
https://download.qt.io/archive/qt/
Two: Select the version
Choose to download the linux version of version 5.9.8
Three: Enable shared folders
After the download is complete, you can share the installation package to the LINUX system through file sharing, and then copy it to the / directory: (If there is no file sharing, you can use WINSCP to transfer to the virtual machine)
Enter the command to grant permissions to the installation package
sudo chmod -R 777 qt-opensource-linux-x64-5.9.8.run
Entering the command to install qt will install qt under /opt by default
sudo ./qt-opensource-linux-x64-5.9.8.run
It is best to register and use after installing qt now
Required options: Desktop gcc 64-bit Sources Developer and Designer Tools
The box below is selected as a mandatory option, be sure to choose!
continue
Install
Four: Run the Qt project
Compile the Qt project and find a prompt: "-1:error:cannot find -IGL error", use the following command and re-run it to solve it
sudo apt-get install libgl1-mesa-dev
Five: The use of UI in Qt
Create an application project
Set the project name and project path (the project name should not be named in Chinese)
Click Next by default
Check ui for the design interface
Click Finish to enter the project
The shadow directory is checked by default, uncheck it!
It can be set that the Qt project will no longer generate shadow directories by default in the future. The specific steps are as follows
First, menu bar, tools, options
Click Build and Run on the left
Only keep in the Default build directory . Click Apply, click OK
Next, the interface can be designed
what you see is what you get
In the UI design of Qt, it is possible to set the slot function of the button
Right button (control), go to slot
The slot function will be automatically generated in the header file and source file of the specified design window, and you can write the implementation method yourself ( no need to write connect again!)