1. Use QT crearot to create a custom control project. During the creation process, specify the created class and the Instance name of the created class. In this way, you can directly use it in the future. The icon file must be specified here to be displayed in the designer.
2. Compile the corresponding processing functions in the created project. You can mainly reload the onpaint function to design the desired custom widget content.
3. Select the version to compile.
4. in the compiled running directory, run the make install command on the console to install the control to the plug-in/designer of the current version by default. so file (in Linux)
5. Assign the generated and installed. So file to the installation directory bin/designer of QT creator so that you can view the custom control in the designer window by opening QT creator again. You can use it like other built-in QT controls.
6. Copy the. H. cpp. PRI file written in the custom control to the directory of the project using the control.
7. Add include (**. prii) to the. Pro file of the project using the control to compile and run the program.