table of contents
KGENDESIGNERPLUGI(1) | KDE Frameworks: KDesignerPlugi | KGENDESIGNERPLUGI(1) |
NAME¶
kgendesignerplugin - Generates widget plugins for Qt(TM) Designer.
SYNOPSIS¶
kgendesignerplugin [OPTIONS...] file
DESCRIPTION¶
The custom widget plugins for Qt(TM) Designer usually follow a standard pattern, and the classes provided by the plugin mostly provide static information, along with function to create an instance that is normally just a simple constructor call. kgendesignerplugin allows developers of libraries that provide new widgets to create such a plugin without creating all the associated boilerplate code, by providing a simple ini-style description file.
kgendesignerplugin chooses sensible defaults for most settings, so minimal configuration is usually necessary.
OPTIONS¶
-o file
-n plugin-name
-g group
--author
--license
-h, --help
-v , --version
FILE FORMAT¶
The input file is an ini-style configuration file (specifically, it is in the format supported by the KConfig framework) that describes a set of widgets. It contains a [Global] section, providing general information about the plugin, and a section for each widget that should be included in the plugin.
The [Global] section can have the following entries:
DefaultGroup
Includes
PluginName
Each class should have its own [ClassName] section, which can include the following entries:
CodeTemplate
ConstructorArgs
This entry is ignored if CreateWidget is set.
CreateWidget
DomXML
Group
IconName
ImplClass
This entry is ignored if CreateWidget is set.
IncludeFile
IsContainer
ToolTip
WhatsThis
EXAMPLES¶
The simplest description file might look like:
[Foo] ToolTip=Displays foos [Bar] ToolTip=Bar editor
Note that each class must have at least one key set (ToolTip was used in this example), otherwise it will be ignored.
Usually, you want to change at least the user-visible text, which means the ToolTip, WhatsThis and Group entries. Additionally, setting the plugin name can be a good idea to prevent possible symbol clashes and not confuse debuggers (both the debugger application and the person doing the debugging):
[Global] PluginName=FooWidgets DefaultGroup=Display [Foo] ToolTip=Displays bears WhatsThis=An image widget that displays dancing bears [Bar] ToolTip=Bar editor WhatsThis=An editor interface for bars for bears Group=Editing
More complex files may be necessary if you have namespaced classes or extra options that need supplying to constructors, for example:
[Global] PluginName=FooWidgets DefaultGroup=Foo [Foo::Bar] ToolTip=Displays bars WhatsThis=A widget that displays bars in a particular way IncludeFile=foo/bar.h IconName=:/previews/bar.png [Foo::Baz] IncludeFile=foo/baz.h ConstructorArgs=(Foo::Baz::SomeOption, parent) Group=Foo (Special) IsContainer=true IconName=:/previews/baz.png
Sometimes especially complex widgets might need a special "preview class" implementation for use in Qt(TM) Designer; this might be a subclass of the real widget that just does some extra setup, or it might be a completely different implementation.
[Global] Includes=foopreviews.h [FancyWidget] ImplClass=FancyWidgetPreview
SEE ALSO¶
https://doc.qt.io/qt-5/designer-creating-custom-widgets.html
BUGS¶
Please use KDE's bugtracker[1] to report bugs, do not mail the authors directly.
AUTHORS¶
Richard Johnson <rjohnson@kde.org>
Alex Merry <alexmerry@kde.org>
NOTES¶
- 1.
- KDE's bugtracker
2014-05-28 | KDE Frameworks Frameworks 5.0 |