moved to shstk
This commit is contained in:
1
libs/sql_table/plugin/CMakeLists.txt
Normal file
1
libs/sql_table/plugin/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
qad_plugin(sql_table "Gui;Widgets;Sql" "")
|
||||
19
libs/sql_table/plugin/qad_sql_table.cpp
Normal file
19
libs/sql_table/plugin/qad_sql_table.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "qad_sql_table.h"
|
||||
#include "sql_table_plugin.h"
|
||||
#include "sql_record_plugin.h"
|
||||
|
||||
|
||||
QADSQLTable::QADSQLTable(QObject * parent): QObject(parent) {
|
||||
m_widgets.append(new SQLTablePlugin(this));
|
||||
m_widgets.append(new SQLRecordPlugin(this));
|
||||
}
|
||||
|
||||
|
||||
QList<QDesignerCustomWidgetInterface * > QADSQLTable::customWidgets() const {
|
||||
return m_widgets;
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_EXPORT_PLUGIN2(qad_sql_table_plugin, QADSQLTable)
|
||||
#endif
|
||||
23
libs/sql_table/plugin/qad_sql_table.h
Normal file
23
libs/sql_table/plugin/qad_sql_table.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef QAD_SQL_TABLE_H
|
||||
#define QAD_SQL_TABLE_H
|
||||
|
||||
#include <QtDesigner/QtDesigner>
|
||||
#include <QtCore/qplugin.h>
|
||||
|
||||
class QADSQLTable: public QObject, public QDesignerCustomWidgetCollectionInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "qad.sql_table")
|
||||
#endif
|
||||
public:
|
||||
explicit QADSQLTable(QObject * parent = 0);
|
||||
virtual QList<QDesignerCustomWidgetInterface * > customWidgets() const;
|
||||
|
||||
private:
|
||||
QList<QDesignerCustomWidgetInterface * > m_widgets;
|
||||
|
||||
};
|
||||
|
||||
#endif // QAD_SQL_TABLE_H
|
||||
69
libs/sql_table/plugin/sql_record_plugin.cpp
Normal file
69
libs/sql_table/plugin/sql_record_plugin.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "sql_record_widget.h"
|
||||
#include "sql_record_plugin.h"
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
|
||||
SQLRecordPlugin::SQLRecordPlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void SQLRecordPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
|
||||
if (m_initialized)
|
||||
return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool SQLRecordPlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * SQLRecordPlugin::createWidget(QWidget * parent) {
|
||||
return new SQLRecordWidget(parent);
|
||||
}
|
||||
|
||||
|
||||
QString SQLRecordPlugin::name() const {
|
||||
return QLatin1String("SQLRecordWidget");
|
||||
}
|
||||
|
||||
|
||||
QString SQLRecordPlugin::group() const {
|
||||
return QLatin1String("Editor Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon SQLRecordPlugin::icon() const {
|
||||
return QIcon(":/icons/sql_table.png");
|
||||
}
|
||||
|
||||
|
||||
QString SQLRecordPlugin::toolTip() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
QString SQLRecordPlugin::whatsThis() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
bool SQLRecordPlugin::isContainer() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString SQLRecordPlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"SQLRecordWidget\" name=\"recordSQL\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString SQLRecordPlugin::includeFile() const {
|
||||
return QLatin1String("sql_record_widget.h");
|
||||
}
|
||||
|
||||
36
libs/sql_table/plugin/sql_record_plugin.h
Normal file
36
libs/sql_table/plugin/sql_record_plugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef SQLRECORDPLUGIN_H
|
||||
#define SQLRECORDPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class SQLRecordPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
SQLRecordPlugin(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 // SQLRECORDPLUGIN_H
|
||||
69
libs/sql_table/plugin/sql_table_plugin.cpp
Normal file
69
libs/sql_table/plugin/sql_table_plugin.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "sql_table_widget.h"
|
||||
#include "sql_table_plugin.h"
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
|
||||
SQLTablePlugin::SQLTablePlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void SQLTablePlugin::initialize(QDesignerFormEditorInterface * /* core */) {
|
||||
if (m_initialized)
|
||||
return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool SQLTablePlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * SQLTablePlugin::createWidget(QWidget * parent) {
|
||||
return new SQLTableWidget(parent);
|
||||
}
|
||||
|
||||
|
||||
QString SQLTablePlugin::name() const {
|
||||
return QLatin1String("SQLTableWidget");
|
||||
}
|
||||
|
||||
|
||||
QString SQLTablePlugin::group() const {
|
||||
return QLatin1String("Editor Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon SQLTablePlugin::icon() const {
|
||||
return QIcon(":/icons/sql_table.png");
|
||||
}
|
||||
|
||||
|
||||
QString SQLTablePlugin::toolTip() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
QString SQLTablePlugin::whatsThis() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
bool SQLTablePlugin::isContainer() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString SQLTablePlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"SQLTableWidget\" name=\"tableSQL\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString SQLTablePlugin::includeFile() const {
|
||||
return QLatin1String("sql_table_widget.h");
|
||||
}
|
||||
|
||||
36
libs/sql_table/plugin/sql_table_plugin.h
Normal file
36
libs/sql_table/plugin/sql_table_plugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef SQLTABLEPLUGIN_H
|
||||
#define SQLTABLEPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class SQLTablePlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
SQLTablePlugin(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 // SQLTABLEPLUGIN_H
|
||||
Reference in New Issue
Block a user