QT Use tutorial to create an application based on QT parts (i)

Source: Internet
Author: User
Tags qt designer

<QT Enterprise Latest edition Download >

This tutorial focuses on using QT creator to create a small QT application for text search, which is a simplified version of the QT UI Tools text Finder example. The user interface of the application is built using QT Designer by the Qt widget, and the logic of the application is written using C + + in the Code Editor.

Create a text Search item

1. Select File > New file or Project > Application > Qt Widgets Application > Choose.

Open the Introduction and Project Location dialog box

2. Enter Textfinder in the Name field.

3. Enter the path to the project file in the Create in field, such as C:\Qt\examples, then click Next (in Windows and Linux) or continue (in OS X). Open the Kit selection dialog box.

4. Select Build or run kits for your project, then click Next or Continue.

Note: If you are in Tools > Options > Build & Run > Kits (on Windows and Linux) or in QT Creator > Preferences build & ; Run > Kits (on OS X) only one kit is specified, then this dialog will be skipped.

Open the Class Information dialog box

5. Enter Textfinder as the class name in the Class name field

6. In the base class list, select Qwidget as the type of the base class.

Note: The Header file, Source file, and form file fields are automatically updated to match the name of the class.

7. Click Next or continue to open the Project Management dialog box.

8. Check the settings for the project and click Finish (on Windows and Linux) or done (on OS X) to create the project.

Note: Open the project in edit mode and hide the instructions, to return to these designations, open the Help mode.

The Textfinder project now contains the following files:

    • Textfinder.h

    • Textfinder.cpp

    • Main.cpp

    • Textfinder.ui

    • Textfinder.pro

The. h and. cpp files provide the necessary formulation code that the. Pro file is complete.

interested friends can click to see more articles about QT !

QT Use tutorial to create an application based on QT parts (i)

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.