git-svn-id: svn://db.shs.com.ru/libs@586 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
1
test/qad/graphic/plugin/CMakeLists.txt
Normal file
1
test/qad/graphic/plugin/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
qad_plugin(graphic "Gui;Widgets;OpenGL" "")
|
||||
69
test/qad/graphic/plugin/graphicplugin.cpp
Normal file
69
test/qad/graphic/plugin/graphicplugin.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "graphic.h"
|
||||
#include "graphicplugin.h"
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
|
||||
GraphicPlugin::GraphicPlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void GraphicPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
|
||||
if (m_initialized)
|
||||
return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool GraphicPlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * GraphicPlugin::createWidget(QWidget * parent) {
|
||||
return new Graphic(parent);
|
||||
}
|
||||
|
||||
|
||||
QString GraphicPlugin::name() const {
|
||||
return QLatin1String("Graphic");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicPlugin::group() const {
|
||||
return QLatin1String("Display Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon GraphicPlugin::icon() const {
|
||||
return QIcon(":/icons/graphic.png");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicPlugin::toolTip() const {
|
||||
return QLatin1String("");//QLatin1String("Widget for display any math graphics with grid and navigation");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicPlugin::whatsThis() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
bool GraphicPlugin::isContainer() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString GraphicPlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"Graphic\" name=\"graphic\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicPlugin::includeFile() const {
|
||||
return QLatin1String("graphic.h");
|
||||
}
|
||||
|
||||
36
test/qad/graphic/plugin/graphicplugin.h
Normal file
36
test/qad/graphic/plugin/graphicplugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef GRAPHICPLUGIN_H
|
||||
#define GRAPHICPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class GraphicPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
GraphicPlugin(QObject * parent = 0);
|
||||
|
||||
bool isContainer() const;
|
||||
bool isInitialized() const;
|
||||
QIcon icon() const;
|
||||
QString domXml() const;
|
||||
QString group() const;
|
||||
QString includeFile() const;
|
||||
QString name() const;
|
||||
QString toolTip() const;
|
||||
QString whatsThis() const;
|
||||
QWidget * createWidget(QWidget * parent);
|
||||
void initialize(QDesignerFormEditorInterface * core);
|
||||
|
||||
private:
|
||||
bool m_initialized;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
17
test/qad/graphic/plugin/qad_graphic.cpp
Normal file
17
test/qad/graphic/plugin/qad_graphic.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "qad_graphic.h"
|
||||
#include "graphicplugin.h"
|
||||
|
||||
QADGraphic::QADGraphic(QObject * parent): QObject(parent)
|
||||
{
|
||||
m_widgets.append(new GraphicPlugin(this));
|
||||
}
|
||||
|
||||
|
||||
QList<QDesignerCustomWidgetInterface * > QADGraphic::customWidgets() const {
|
||||
return m_widgets;
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_EXPORT_PLUGIN2(qad_graphic_plugin, QADGraphic)
|
||||
#endif
|
||||
23
test/qad/graphic/plugin/qad_graphic.h
Normal file
23
test/qad/graphic/plugin/qad_graphic.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef QAD_GRAPHIC_H
|
||||
#define QAD_GRAPHIC_H
|
||||
|
||||
#include <QtDesigner/QtDesigner>
|
||||
#include <QtCore/qplugin.h>
|
||||
|
||||
class QADGraphic: public QObject, public QDesignerCustomWidgetCollectionInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "qad.graphic")
|
||||
#endif
|
||||
public:
|
||||
explicit QADGraphic(QObject * parent = 0);
|
||||
virtual QList<QDesignerCustomWidgetInterface * > customWidgets() const;
|
||||
|
||||
private:
|
||||
QList<QDesignerCustomWidgetInterface * > m_widgets;
|
||||
|
||||
};
|
||||
|
||||
#endif // QAD_GRAPHIC_H
|
||||
Reference in New Issue
Block a user