
Originally Posted by
marcel
Does your pro file contains ?
Thanks for that. Now it has the error
customgvplugin.cpp: In function ‘QObject* qt_plugin_instance()’:
customgvplugin.cpp:73: error: cannot allocate an object of abstract type ‘customgvPlugin’
customgvplugin.h:4: note: because the following virtual functions are pure within ‘customgvPlugin’:
/usr/local/Trolltech/Qt-4.3.1/include/QtDesigner/customwidget.h:66: note: virtual QWidget* QDesignerCustomWidgetInterface::createWidget(QWidg et*)
make[1]: *** [release/customgvplugin.o] Error 1
make[1]: Leaving directory `/root/workspace/IADFUQ/PLUGINS/customgvplugin'
make: *** [release] Error 2
this is on last line
Q_EXPORT_PLUGIN2(customgvplugin, customgvPlugin)
Q_EXPORT_PLUGIN2(customgvplugin, customgvPlugin)
To copy to clipboard, switch view to plain text mode
here' the full code of the plugin
#include "customgv.h"
#include "customgvplugin.h"
#include <QtPlugin>
initialized = false;
}
if (initialized)
return;
initialized = true;
}
bool customgvPlugin::isInitialized() const {
return initialized;
}
{
return new customgv(scene, parent);
}
QString customgvPlugin
::name() const { return "IADFUQGraphicsView";
}
QString customgvPlugin
::group() const { return "Display Widgets [Examples]";
}
QIcon customgvPlugin
::icon() const { }
QString customgvPlugin
::toolTip() const { return "";
}
QString customgvPlugin
::whatsThis() const { return "";
}
bool customgvPlugin::isContainer() const {
return false;
}
QString customgvPlugin
::domXml() const { return "<widget class=\"customgv\" name=\"customgv\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>100</width>\n"
" <height>100</height>\n"
" </rect>\n"
" </property>\n"
" <property name=\"toolTip\" >\n"
" <string>IADFUQ GRAPHICS VIEW</string>\n"
" </property>\n"
" <property name=\"whatsThis\" >\n"
" <string>IADFUQ GRAPHICS VIEW</string>\n"
" </property>\n"
"</widget>\n";
}
QString customgvPlugin
::includeFile() const { return "customgv.h";
}
Q_EXPORT_PLUGIN2(customgvplugin, customgvPlugin)
#include "customgv.h"
#include "customgvplugin.h"
#include <QtPlugin>
customgvPlugin::customgvPlugin(QObject *parent):QObject(parent) {
initialized = false;
}
void customgvPlugin::initialize(QDesignerFormEditorInterface *) {
if (initialized)
return;
initialized = true;
}
bool customgvPlugin::isInitialized() const {
return initialized;
}
QGraphicsView *customgvPlugin::createWidget(QGraphicsScene *scene, QWidget *parent)
{
return new customgv(scene, parent);
}
QString customgvPlugin::name() const {
return "IADFUQGraphicsView";
}
QString customgvPlugin::group() const {
return "Display Widgets [Examples]";
}
QIcon customgvPlugin::icon() const {
return QIcon();
}
QString customgvPlugin::toolTip() const {
return "";
}
QString customgvPlugin::whatsThis() const {
return "";
}
bool customgvPlugin::isContainer() const {
return false;
}
QString customgvPlugin::domXml() const {
return "<widget class=\"customgv\" name=\"customgv\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>100</width>\n"
" <height>100</height>\n"
" </rect>\n"
" </property>\n"
" <property name=\"toolTip\" >\n"
" <string>IADFUQ GRAPHICS VIEW</string>\n"
" </property>\n"
" <property name=\"whatsThis\" >\n"
" <string>IADFUQ GRAPHICS VIEW</string>\n"
" </property>\n"
"</widget>\n";
}
QString customgvPlugin::includeFile() const {
return "customgv.h";
}
Q_EXPORT_PLUGIN2(customgvplugin, customgvPlugin)
To copy to clipboard, switch view to plain text mode
Does this mean I can't create my own QGraphicsView to be integrated with QDesigner? (because QGraphicsView does not directly inherit the QWidget class? Instead QGraphicsView inherits from QAbstractScrollArea) (?)
Bookmarks