How to load the plug-in to QT designer

Source: Internet
Author: User
Tags qt designer

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,

 

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.