I'm trying to create a fake customplugin to access QtDesigner istance.
I'm editing "taskmenuextension" project to redefine:
void TicTacToePlugin::initialize(QDesignerFormEditorInterface *formEditor)
To copy to clipboard, switch view to plain text mode
QDesignerFormEditorInterface is a interface to access at WidgetBox(QDesignerWidgetBoxInterface)
{
widgetBox = formEditor->widgetBox();
if (widgetBox) {
qDebug()<<"Ok widgetBox";
} else {
qDebug()<<"NO widgetBox";
}
}
void TicTacToePlugin::initialize(QDesignerFormEditorInterface *formEditor)
{
QDesignerWidgetBoxInterface *widgetBox = 0;
widgetBox = formEditor->widgetBox();
if (widgetBox) {
qDebug()<<"Ok widgetBox";
} else {
qDebug()<<"NO widgetBox";
}
}
To copy to clipboard, switch view to plain text mode
I followed these steps:
- i have compiled "taskmenuextension" project (generating libtaskmenuextension.so)
- copy libtaskmenuextension.so in QtDesigner pluginDir
- in command line type
emmanuelgranatello@isi-82:~$ designer
NO widgetBox
The widgetBox is equal to NULL because the main window (and consequently the WidgetBox) is instantiated after loading the plugin ![Frown](images/smilies/frown.png)
Anyone knows how to use QDesignerWidgetBoxInterface?
Added after 52 minutes:
I found (in sourcecode) the xml file that populates the Widgetbox's qtdesignr.
the folder is:
Qt_sourcecode_4.7.1/tools/designer/src/components/widgetbox
xml file:
widgetbox.xml
This file is included as a resource(.qrc) in the project.
Bookmarks