QCAD
Open Source 2D CAD
|
In this example the widget we want to make usable for the designer is called RListView
, which is derived from QListView
. The plugin class we create will be named RListViewPlugin
.
Create the new header file as shown below:
Create the new class. Be sure to include both, the Plugin header file just created, and the header file of the widget you want to map. It might be necessary to include the base class of your class as well, in this example QListView
(RListView
derives for QListView
).
Every plugin must be initialized in RCustomWidgets:
That's it. Re-start the Designer and check if the plugin library is loaded correctly (Menu "About: Plugins"). The newly create custom widgets is now shown under the group "RCustomWidgets".