Qt Introductory Learning--QT 5 How to use the Help document
Learning graphic interface development, is certainly inseparable from the use of help documents, because it does not like C language as a few function interfaces, graphics interface can be used to describe the interface, the common we may be able to remember, the other really do not need to remember, use what to help document viewing usage.
We use Qt help documentation, which is mainly divided into the following steps:
1) Introduction to the use of the class
2) View the corresponding member function (function, parameter, return value) of the part (class) used
3) View the signal of the part
4) View the event of the part (how the virtual function is written)
1) Introduction to the use of the class
Move the cursor to the place where the class name is, then press "F1" to jump to the corresponding Help file:
Press "F1" again to display the Help document page in full screen, and press "ESC" to exit the Help document.
Description of the class:
A few important information to look at:
- Public member functions: related functions for manipulating part properties.
- Public slot function: A well-defined slot function in the QT class that can be connected directly to the signal.
- Signal: Soft interrupt, such as pressing the button to trigger the pressed () signal.
- Protection member function: The virtual function that the event corresponds to is usually placed here.
- Event: A common event, such as a mouse event triggered by an action mouse.
Of course, we can enter the class you want to see directly in the " index " input box in " Help " mode:
2) View the corresponding member function (function, parameter, return value) of the part (class) used
View the corresponding member functions of the used part (the member function itself, the inherited member function), primarily to see how this member function is used, including functions, parameters, and return values.
The following is an example of Qpushbutton (normal button):
A) Select the "Public function" in the Qpushbutton class:
b) A brief description of the corresponding function:
c) Click on the function name to see its corresponding usage:
d) Many times, we need to use the inherited function , such as the button set content (SetText ()) is inherited from the Qabstractbutton:
Click "Qabstractbutton" to jump to the place where the Qabstractbutton public functions are:
Click the function name to see its usage:
e) During the operation, you may need to use "back", "forward" to switch pages back and forth:
f) A lot of things, we may need to look at the usage of a function when we use it.
First, you need to fill in the parameters of the function , then, the cursor moves to the function name, and then press "F1" to jump to the use of this function instructions:
3) View the signal of the part
Or take Qpushbutton as an example:
A) You cannot view signals information directly in the Qpushbutton class and need to find it in its base class "Qabstractbutton":
b) in "Qabstractbutton", select "signals":
c) In addition to its own signal, there are inherited signals:
d) Click on the signal name to see a description of the signal:
4) View the event of the part (how the virtual function is written)
Parts commonly used events are declared in Qwidget, select "Events" to see the relevant instructions:
Each event corresponds to an event function:
Description of the event function:
Qt Introductory Learning--QT 5 How to use the Help document