How does QT implement Hello World! program
This article is about how QT implements Hello World! The content of the program. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Download and install QT
Download address of QT: https://www1.qt.io/cn/
The latest version should be 5.10. I downloaded 5.9.4. You can download and install Baidu. I won't go into details.
QTCreator
New project
After we open QTCreator, click File-- New File and Project
Select a console application
Change its name to HelloWorld
Go on to the next step, and the next step will be done.
This generates our project.
Add # include to it
And then add it to the code
Then click the green triangle symbol in the lower left corner, which will prompt you to save it and run it directly.
Then our interface console program prints out Hello Worldlings!
And can # include
To implement it in cout way, this is to consolidate the C++ method that I learned two days ago.
Then we add a variable std::string name to the code
Input with std::cin
Then use std::cout to output
Let's rerun the program:
At this time, a new line is displayed after printing Hello World in the console. Please enter your name:
We enter Vaccae
Click enter again to print out the Hello World Vaccae
The first Hello World is complete!
Thank you for reading! This is the end of this article on "how to achieve Hello World in QT!". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!