Note: This document assumes that you have successfully installed QtSDK on your operating system in Ubuntu. If not, refer to this URL: Installation
Note: This document assumes that you have successfully installed the Qt SDK on your operating system in Ubuntu. If not, see this URL: http://www.linuxidc.com/Linux/2012-11/74757.htm
Steps:
1-> open a terminal and enter the following command to create the main directory of a Qt Program
Mkdir QtHelloWorld
2-> run the following command to change the QtHelloWorld directory:
Cd QtHelloWorld
3-> In the QtHelloWorld directory, we want to create the source code file of our Qt program.
Gedit main. cpp
4-> now add the code at the bottom to the source code file of your main. cpp, save the file, and exit
5-> In the QtHelloWorld directory, enter the following command:
Qmake-project
Qmake
Make
6-> the QtHelloWorld directory contains a "QtHelloWorld" executable file. Run the following command:
./QtHelloWorld
- # Include
- # Include
- # Include
- IntMain (IntArgc,Char* Argv [])
- {
- QApplication app (argc, argv );
- QLabel hello (" Welcome to my first WikiHow Qt program ");
- Hello. setWindowTitle ("My First WikiHow Qt Program ");
- Hello. resize (400,400 );
- Hello. show ();
- ReturnApp.exe c ();
- }