QT Learning Path - First program HelloWorld!
preamble
After learning OpenCV a while ago, I feel that if I do image processing, it is much faster than C++ in terms of efficiency and speed, and then I researched QT, which is also cross-platform, so I am ready to start QT, because I need a foundation in C++ to learn QT, and the last two weeks have been badly supplementing C++, which is a little gain, so today I started learning QT, which is also a consolidation of the recently learned C++.
QT download and installation
QT's download address https://www1.qt.io/cn/
The latest version should be 5.10, I downloaded is 5.9.4, download and install can be Baidu, I will not go into details here
QTCreator
New construction projects
After we open QTCreator, click on File - New File and Project
Select a control desk application
Change the name to HelloWorld
Then next, next until you're done.
This generates our project.
Add #include to the top
Then add to the code
Then click on the green triangle symbol in the bottom left corner, you will be prompted to save and run it directly
Then our interface console program prints out Hello World!!!
There is also the possibility to #include
This is done in cout, to consolidate the C++ methods learned two days ago
Then we add a variable std::string name inside the code;
Input with std::cin
Then output with std::cout
Let's rerun the program:
At this point a new line is displayed in the console after Hello World is printed Please enter your name:
We type in Vaccae
Hit enter again and it will print out Hello World Vaccae
The first Hello World is complete!!!
-END-
Long press the two-dimensional code below to follow