PDA

View Full Version : Embed Qt Designer



emmynet
20th April 2011, 12:29
How can I embed Qt Designer in my application?
Somebody have some examples?
There are license problems?
tnks :)

high_flyer
21st April 2011, 10:07
Which functionality from designer do you need?
embedding the whole designer in another application makes little sense - just start it with QProcess.
But you can use various functionalities in your own application.
Explain more what you are after.

emmynet
21st April 2011, 10:37
I think I follow your solution, but ....
i needed to customizing QtDesigner inhibiting widget from the list "widget box" type:
-View-Item (model-based)
-Widget-item

any ideas?

high_flyer
21st April 2011, 10:52
Well, if you want designer as designer, but modified, then you have to modify designer.
You can the code - so you will have to dive in and change what you need in the designer code it self.

squidge
21st April 2011, 14:19
Qt Designer is open source so you can embed as much or as little as you want in your own code, just ensure you abide by the license and publish your modified source code some where.

emmynet
21st April 2011, 15:52
I'm trying to create a fake customplugin to access QtDesigner istance.
I'm editing "taskmenuextension" project to redefine:

void TicTacToePlugin::initialize(QDesignerFormEditorInt erface *formEditor)

QDesignerFormEditorInterface is a interface to access at WidgetBox(QDesignerWidgetBoxInterface)



void TicTacToePlugin::initialize(QDesignerFormEditorInt erface *formEditor)
{
QDesignerWidgetBoxInterface *widgetBox = 0;
widgetBox = formEditor->widgetBox();
if (widgetBox) {
qDebug()<<"Ok widgetBox";
} else {
qDebug()<<"NO widgetBox";
}
}

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 :(

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.