This article describes how to load the plug-in to QT designer. The plug-in is a program written by following certain specifications of the application interface. For more information about QT designer, see the content first.
This article describes how to load a custom plug-in to QT designer. For plug-ins, the plug-in is a program written by following certain specifications of the application interface. Many software have plug-ins, and there are countless plug-ins. For example, after installing the relevant plug-ins in IE, the Web browser can directly call the plug-in program to process specific types of files.
Step 1: create a custom widget.
You can subclass an existing widget or subclass qwidget to create a custom widget. I am a widget created by subclass qwidget. In this way, a new form is created, and some signal and slot connections can be set in it. Note that the implementation code of this form must be debugged in the compiler. After this window is complete, we need to proceed to the next step.
Step 2: integrate custom widgets in the QT designer.
I use the plug-in method. In this method, I need to create a plug-in Library. QT designers can load this library at runtime and use this library to create windows component instances. It is a subclass of qdesignercustomwidgetinterface, as long as you re-implement some virtual functions. Note: At the end of the source file implementing the plug-in class, you must use the q_export_plugin2 () macro to use this plug-in the QT designer.
Step 3: Create the. Pro file for this plug-in.
Note that the path of the heades and sources variables in the file must be set correctly.
Step 4: run the qmake command.
Copy the header files, source files, and build the plug-in. Pro files of these two classes to the same folder. Enter qmake or qmake-project in the Command Prompt window of QT and press Enter. Three makefile files and two folders are generated. The debug folder is empty.
Step 5: run the nmake command.
After execution, A. PDB file is generated in the current directory, and some MOC, DLL, Lib, and other files are generated in the DEBUG directory.
If no error is prompted, you can load the custom plug-in to QT designer. You can search in QT designer. Is a custom iconeditor plug-in:
For how to load the plug-in to QT designer in this article, I don't know if it helps you,