vieraci
22nd November 2009, 06:43
I've made a designer widget but it has some shortcomings.
It's basically a combobox with some added functionality, but when I use it in the gui editor it doesn't come up in the tab order list and setFocus() doesn't work. I think it's because I've derived my part from QWidget, I tried changing the base class to QComboBox but it doesn't compile. The alternative is to subclass setFocous() and then do cb.setFocus() from within the class but this is not a proper solution
dbcomboboxplugin.cpp: In function ‘QObject* qt_plugin_instance()’:
dbcomboboxplugin.cpp:91: error: cannot allocate an object of abstract type ‘DbComboBoxPlugin’
dbcomboboxplugin.h:9: note: because the following virtual functions are pure within ‘DbComboBoxPlugin’:
/usr/include/qt4/QtDesigner/customwidget.h:71: note: virtual QWidget* QDesignerCustomWidgetInterface::createWidget(QWidg et*)
I've attached the 2 header files.
It's basically a combobox with some added functionality, but when I use it in the gui editor it doesn't come up in the tab order list and setFocus() doesn't work. I think it's because I've derived my part from QWidget, I tried changing the base class to QComboBox but it doesn't compile. The alternative is to subclass setFocous() and then do cb.setFocus() from within the class but this is not a proper solution
dbcomboboxplugin.cpp: In function ‘QObject* qt_plugin_instance()’:
dbcomboboxplugin.cpp:91: error: cannot allocate an object of abstract type ‘DbComboBoxPlugin’
dbcomboboxplugin.h:9: note: because the following virtual functions are pure within ‘DbComboBoxPlugin’:
/usr/include/qt4/QtDesigner/customwidget.h:71: note: virtual QWidget* QDesignerCustomWidgetInterface::createWidget(QWidg et*)
I've attached the 2 header files.