[Kommander-devel] Making a Kommander editor using Designer 4

Eric Laffoon eric at kdewebdev.org
Tue Apr 15 19:38:23 EDT 2008


Hi all,
Especially Andras. ;) I committed the required files to make a Kommander 
widget plugin group. There are several issues before it can be tested.
The following example from a plugin file illustrates

QWidget *ButtonGroupKmdrDesignerPlugin::createWidget(QWidget *parent)
{
  return new ButtonGroup(parent);
}

The compiler rightly points out this is not correct as the constructor 
requires another vairable, the name variable. However I added this locally so 
it calls

QWidget *ButtonGroupKmdrDesignerPlugin::createWidget(QWidget *parent, const 
char *name)
{
  return new ButtonGroup(parent, name);
}

The changes to headers were made and everything is right... Except of course 
that I'm mucking with not just the widget constructor, but the virtual 
function in the QDesigner plugin. Now it is not happy...

/home/eric/kdesvn/kdewebdev/kommander/widgets/kmdrdesignerwidgets.cpp:18: 
error: cannot allocate an object of abstract 
type 'ButtonGroupKmdrDesignerPlugin'
/home/eric/kdesvn/kdewebdev/kommander/widgets/buttongroupkmdrdesignerplugin.h:26: 
note:   because the following virtual functions are pure 
within 'ButtonGroupKmdrDesignerPlugin':
/usr/local/Trolltech/Qt-4.4.0-beta1/include/QtDesigner/customwidget.h:73: 
note: virtual QWidget* QDesignerCustomWidgetInterface::createWidget(QWidget*)

So what is happening with the name in the constructor? Is Kommander being 
passed the widget name here? My understanding of C++ is not perfect, but we 
can't declare ButtonGroupKmdrDesignerPlugin without the name and return 
ButtonGroup with the name. I may be missing something here... It looks like 
we either drop the name from the constructor, in which case how do we manage 
getting the name for Kommander (and does this break everything else) or ask 
the trolls if we can have a patch on this function. A third option is a 
brilliant insight I'm hoping someone else has on this list.

BTW the other problem is outputting this library to where Designer will see 
it, which I believe is probably the Designer plugin library directory and I'm 
not sure how to do that in CMakeLists.txt.
-- 
Eric Laffoon
Project Lead - kdewebdev module


More information about the Kommander-devel mailing list