#include <MultiViewPlugin.h>
Inherits QObject, and QDesignerCustomWidgetInterface.
Simple qt designer plugin class. Only thing to note that the multi view widget is used as a container widget. It handles the adding of widgets for the MultiViewWidget in a QTDesigner specific way. No preview will be shown as QT Designer can not handle widgets which will be taken care of by the MultiViewWidget.
Definition at line 25 of file MultiViewPlugin.h.
| MultiViewPlugin::MultiViewPlugin |
( |
QObject * |
parent | ) |
|
| MultiViewPlugin::~MultiViewPlugin |
( |
| ) |
|
|
virtual |
| void MultiViewPlugin::activeFormWindowChanged |
( |
QDesignerFormWindowInterface * |
formWindow | ) |
|
|
slot |
Called when the active Form window was changed. Used when loading a ui file to know when the designer is ready to add teh already added widgets
- Parameters
-
| formWindow | The active form window |
Definition at line 108 of file MultiViewPlugin.cc.
112 if(formWindow != NULL && lastWidgets.size() > 0)
114 for(
unsigned int i=0;i<lastWidgets.size();i++)
void manageWidget(QWidget *widget)
| QWidget * MultiViewPlugin::createWidget |
( |
QWidget * |
parent | ) |
|
Creates the widget which the plugin handles
- Parameters
-
- Returns
- the widget which the plugin shall handle
Definition at line 168 of file MultiViewPlugin.cc.
172 connect(widget, SIGNAL(widgetButtonAdded(QWidget*)),
this, SLOT(
manageWidget(QWidget*)));
void manageWidget(QWidget *widget)
| QString MultiViewPlugin::domXml |
( |
| ) |
const |
Returns an XML defining the plugins internals
- Returns
- an xml string
Definition at line 176 of file MultiViewPlugin.cc.
178 return "<widget class=\"MultiViewWidget\" name=\"MultiViewWidget\">\n"
179 " <property name=\"geometry\">\n"
183 " <width>400</width>\n"
184 " <height>300</height>\n"
187 " <property name=\"toolTip\" >\n"
188 " <string>MultiView</string>\n"
190 " <property name=\"whatsThis\" >\n"
191 " <string>Displays multiple widgets in a container.</string>\n"
| QString MultiViewPlugin::group |
( |
| ) |
const |
Returns a group name
- Returns
- a group name
Definition at line 38 of file MultiViewPlugin.cc.
40 return "Rock-Robotics";
| QIcon MultiViewPlugin::icon |
( |
| ) |
const |
Returns teh icon of the plugin
- Returns
- the icon of the plugin
Definition at line 33 of file MultiViewPlugin.cc.
| QString MultiViewPlugin::includeFile |
( |
| ) |
const |
Returns the include File
- Returns
- the include file
Definition at line 43 of file MultiViewPlugin.cc.
45 return "MultiViewWidget.h";
| void MultiViewPlugin::initialize |
( |
QDesignerFormEditorInterface * |
core | ) |
|
Initializes the plugin
- Parameters
-
| core | Interface given by QT Designer |
Definition at line 63 of file MultiViewPlugin.cc.
void activeFormWindowChanged(QDesignerFormWindowInterface *formWindow)
| bool MultiViewPlugin::isContainer |
( |
| ) |
const |
Returns whether this is a container widget
- Returns
- will always return true
Definition at line 23 of file MultiViewPlugin.cc.
| bool MultiViewPlugin::isInitialized |
( |
| ) |
const |
Returns whether the plugin is initialized
- Returns
- if the plugin is initialized
Definition at line 28 of file MultiViewPlugin.cc.
| void MultiViewPlugin::manageWidget |
( |
QWidget * |
widget | ) |
|
|
slot |
Called when a widget was added so it will be managed correctly in the active form
- Parameters
-
| widget | the widgfet which shall be managed |
Definition at line 78 of file MultiViewPlugin.cc.
88 if(formInterface->formWindowManager()->activeFormWindow() == NULL)
90 lastWidgets.push_back(widget);
98 printf(
"We have here an element in button: %s\n",
typeid(*button->
getWidget()).
name());
99 printf(
"Adding this to: %s\n",
typeid(*formInterface->formWindowManager()->activeFormWindow()).
name());
100 printf(
"Filename for current one is: %s\n",formInterface->formWindowManager()->activeFormWindow()->fileName().toStdString().c_str());
101 formInterface->formWindowManager()->activeFormWindow()->manageWidget(button->
getWidget());
103 printf(
"We have here an non-button: %s\n",
typeid(*widget).name());
| QString MultiViewPlugin::name |
( |
| ) |
const |
Returns the name
- Returns
- the name
Definition at line 48 of file MultiViewPlugin.cc.
50 return "MultiViewWidget";
| void MultiViewPlugin::selectionChanged |
( |
| ) |
|
|
slot |
Called when a preview Button was selected to imitate clicks, which will normally be caught by designer to change the buttons name
Definition at line 123 of file MultiViewPlugin.cc.
126 QWidget* selected = formInterface->formWindowManager()->activeFormWindow()->cursor()->selectedWidget(0);
130 printf(
"It's an button selected with contains: %s\n",
typeid(*button->
getWidget()).
name());
140 printf(
"It's an button selected with contains: %s\n",
typeid(*button->
getWidget()).
name());
143 printf(
"Cannot find Button for: %s\n",
typeid(*selected).name());
151 for(
int i=0;i<buttons.size();i++)
153 if(button != buttons[i])
155 buttons[i]->getWidget()->setMaximumSize(0, 0);
159 buttons[i]->getWidget()->setMaximumSize(1000000, 1000000);
| QString MultiViewPlugin::toolTip |
( |
| ) |
const |
Returns the tooltip
- Returns
- the tooltip
Definition at line 53 of file MultiViewPlugin.cc.
55 return "Widget for displaying multiple widgets";
| QString MultiViewPlugin::whatsThis |
( |
| ) |
const |
Returns a whats this string
- Returns
- teh whatsthis string
Definition at line 58 of file MultiViewPlugin.cc.
60 return "Container widget for other widgets";
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/multi_view/MultiViewPlugin.h
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/multi_view/MultiViewPlugin.cc