Install QT Creator in Linux and use it to develop the entire process of your first QT Project

Source: Internet
Author: User

Install and use QT Creator in Linux

QT is open-source, free, and fully object-oriented (easily Scalable). It is favored by more and more developers for its advantages such as true component programming and portability across platforms. Qt creator is an IDE developed specifically for Qt by Nokia. This article describes how to install QT Creator in Linux, and provides a hello world-level example for the use of QT creator. It is hoped that the first friend who came into contact with QT creator can play a role in attracting others.
Install QT creator

1.Preparation

Download and install QT (for the compilation and installation configuration of QT, refer to the previous article titled compiling and installing Qt in Linux.)
).
2.View

Run the following command to view your computer system:
Uname-
The author is x86_64 GNU/Linux.
3.Download

Download the QT creator matching your computer on the official QT website at http://qt.nokia.com/downloads. The latest version of QT creator is 1.3.0. The author chooses QT creator 1.3.0 binary for Linux/X11 64-bit (48 MB ).
4.Install

Download the 47.2 MB Installation File qt-creator-linux-x86_64-opensource-1.3.0.bin and install it on Linux as follows:
Chmodu + X./qt-creator-linux-x86_64-opensource-1.3.0.bin
/Qt-creator-linux-x86_64-opensource-1.3.0.bin
In this case, the setup QT creator welcome installation dialog box is started, and click "Next"->
On the license page, select "I accept the Agreement" and click "Next"->
Select the QT creator installation directory dialog box. The author chooses/home/defonds/tools/qtcreator/qtcreator-1.3.0, click "Next"->
Prepare the installation interface and click "Next"->
After the installation is complete, click "finish ".
Use QT creator

Create a project helloworld

Start the QT Creator on the desktop. Create a project helloworld, and click "file"-> New file or project... -> select empty qt4 project in projects-> OK-> enter helloworld in the project name. The workbench is free. The author selects/home/defonds/CPP/Qt, next-> finish.
New Class hello

Right-click the project name helloworld, add new... -> under C ++, select C ++ source file and click "OK"-> input class name hello and click "Next"-> finish.
At this time, hello. cpp was created and double-click it to edit it. The edited content still uses the previous blog "Compiling and installing and configuring Qt in Linux".
The content of the example is as follows:

# Include <qapplication> <br/> # include <qlabel> <br/> int main (INT argc, char * argv []) <br/>{< br/> qapplication app (argc, argv); <br/> qlabel * label = new qlabel ("Hello QT! "); <Br/> label-> show (); <br/> return app.exe C (); <br/>}
Save, select build-> run in the menu bar, and select "Hello QT !" The dialog box pops up to verify that the QT program you wrote is compiled.
At this time, an executable file helloworld is generated in the/home/defonds/CPP/QT/helloworld directory. Double-click it to bring up "Hello QT !" Dialog box. It is the first QT project you developed using QT Creator in Linux.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.