Qt learning notes for Windows 02: Create a project under QT creator

Source: Internet
Author: User

After QT and QT creator are installed, the QT creator shortcut icon is generated on the desktop.

1. Double-click the QT creator shortcut icon to enter the QT creator integrated development interface, as shown in figure 1.

Figure 1 Welcome To The QT creator integrated development interface

Qt creator is divided into seven modes: Welcome mode, edit mode, design mode, debug mode, project mode, analysis mode, and help mode, which are switched by the seven icons on the left, the corresponding shortcut key is Ctrl + number 1 to 7.

2. Click the "file" button in the menu bar and select "new file and Project". The Dialog Box 2 is displayed. Select "QT Control Project" under "project", and then select "qt gui application" to generate a desktop qt gui project. Click "select" in the lower right corner.

Figure 2 "new file and project" dialog box

3. Then, the "qt gui application" interface shown in 3 is displayed. Enter the project name and project storage address. Here, the project name is "qttest_hello" and the storage path is "D: \ QT ". Click "Next ". In the displayed dialog box, select "desktop" and "build with shadow ". The purpose of building a shadow is to compile and store the generated files separately from the source code. Click "Next ".

Figure 3 "qt gui application" Interface

4. Then, the "qt gui application" interface shown in 4 is displayed. Select "base class" as "qdialog" to setProgramSet to a dialog box. Click "Next ". In the dialog box that appears, click "finish ".

Figure 4 "qt gui application" Interface

 5. After the creation is complete, the editing mode is displayed, as shown in Figure 5.

Figure 5 editing page

6. Click the "interface file" drop-down arrow in the "project" column and double-click "dialog. UI". The "graphic design" interface shown in Figure 6 is displayed. Select "label" under "display widgets" in the right column and drag it to the canvas in the middle. Double-click "textlabel" and change its content to "Hello World !", 6. Use the CTRL + S shortcut to save the design.

Figure 6 "design" Page

7. Click the green triangle in the lower left corner of the "QT Creator interface" to compile and run the program. The running result shown in 7 is displayed.

Figure 7 running result page

8. When the program is compiled in the "QT test" mode, the QT of the test version is generated. When the program is compiled in the "QT release" mode, the QT of the released version is generated. You can adjust the two modes through the icon above the green triangle in the lower left corner of the "QT Creator interface. The prepared test versions QT and the published versions QT are in the "debug" and "release" under the "QTtest_hello-build-desktop-Qt_4_8_1 _ QT ____ (the file is the same as the project path)" file, respectively.

9. to run the test version QT, not only the "qttest_hello.exe" executable file under the "debug" file is required, you also need to install the "libgcc_s_dw2-1.dll", "mingwm10.dll", "qtcored4.dll", "qtguid4.dll" four files under the bin folder in the QT path. Put them in the same folder, and you can package and release the test version QT.

10. to run QT of the released version, you must not only run the "qttest_hello.exe" executable file in the "relese" file, you also need four files, libgcc_s_dw2-1.dll, mingwm10.dll, qtcore4.dll, and qtgui4.dll, under the bin folder in the QT installation path. Put them in the same folder, and you can package and release the version QT.

 

For new projects under QT creator, see: http://www.qter.org/forum.php? MoD = viewthread & tid = 95 & fromuid = 4

 

 

 

 

 

 

 

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.