new cmake build
git-svn-id: svn://db.shs.com.ru/libs@90 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
20
qad_sql_table/plugin/CMakeLists.txt
Normal file
20
qad_sql_table/plugin/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
project(qad_sql_table_plugin)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
find_package(Qt4 REQUIRED)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QT_INCLUDES} "..")
|
||||
option(DEBUG "Build with -g3" 0)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall")
|
||||
if (DEBUG)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
||||
endif ()
|
||||
set(LIBS ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES} qad_widgets qad_utils)
|
||||
add_definitions(-DQT_PLUGIN)
|
||||
add_definitions(-DQT_NO_DEBUG)
|
||||
add_definitions(-DQT_SHARED)
|
||||
add_definitions(-DQDESIGNER_EXPORT_WIDGETS)
|
||||
file(GLOB PMOCS "./*.h")
|
||||
file(GLOB PCPPS "./*.cpp")
|
||||
qt4_wrap_cpp(PCMOCS ${PMOCS} OPTIONS -nw)
|
||||
add_library(${PROJECT_NAME} SHARED ${PCMOCS} ${PCPPS} ${PMOCS})
|
||||
target_link_libraries(${PROJECT_NAME} ${LIBS} ${QT_QTDESIGNER_LIBRARY} qad_sql_table)
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${QT_PLUGINS_DIR}/designer)
|
||||
17
qad_sql_table/plugin/qad_sql_table.cpp
Normal file
17
qad_sql_table/plugin/qad_sql_table.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
|
||||
Q_EXPORT_PLUGIN2(qad_sql_table_plugin, QADSQLTable)
|
||||
21
qad_sql_table/plugin/qad_sql_table.h
Normal file
21
qad_sql_table/plugin/qad_sql_table.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#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)
|
||||
|
||||
public:
|
||||
explicit QADSQLTable(QObject * parent = 0);
|
||||
virtual QList<QDesignerCustomWidgetInterface * > customWidgets() const;
|
||||
|
||||
private:
|
||||
QList<QDesignerCustomWidgetInterface * > m_widgets;
|
||||
|
||||
};
|
||||
|
||||
#endif // QAD_SQL_TABLE_H
|
||||
69
qad_sql_table/plugin/sql_record_plugin.cpp
Normal file
69
qad_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");
|
||||
}
|
||||
|
||||
31
qad_sql_table/plugin/sql_record_plugin.h
Normal file
31
qad_sql_table/plugin/sql_record_plugin.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef SQLRECORDPLUGIN_H
|
||||
#define SQLRECORDPLUGIN_H
|
||||
|
||||
#include <QDesignerCustomWidgetInterface>
|
||||
|
||||
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
qad_sql_table/plugin/sql_table_plugin.cpp
Normal file
69
qad_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");
|
||||
}
|
||||
|
||||
31
qad_sql_table/plugin/sql_table_plugin.h
Normal file
31
qad_sql_table/plugin/sql_table_plugin.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef SQLTABLEPLUGIN_H
|
||||
#define SQLTABLEPLUGIN_H
|
||||
|
||||
#include <QDesignerCustomWidgetInterface>
|
||||
|
||||
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