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