<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)