version 2.18.0
add GraphicRanges to graphic library new graphic_analysis library
This commit is contained in:
1
libs/graphic_analysis/plugin/CMakeLists.txt
Normal file
1
libs/graphic_analysis/plugin/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
qad_plugin(graphic_analysis "Gui;Widgets" "")
|
||||
71
libs/graphic_analysis/plugin/graphic_analysis_plugin.cpp
Normal file
71
libs/graphic_analysis/plugin/graphic_analysis_plugin.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
#include "graphic_analysis_plugin.h"
|
||||
|
||||
#include "graphic_analysis.h"
|
||||
|
||||
#include <QDesignerFormEditorInterface>
|
||||
#include <QExtensionManager>
|
||||
#include <QtPlugin>
|
||||
|
||||
|
||||
GraphicAnalysisPlugin::GraphicAnalysisPlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = m_designer = false;
|
||||
}
|
||||
|
||||
|
||||
void GraphicAnalysisPlugin::initialize(QDesignerFormEditorInterface * core) {
|
||||
m_designer = true;
|
||||
if (m_initialized) return;
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool GraphicAnalysisPlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * GraphicAnalysisPlugin::createWidget(QWidget * parent) {
|
||||
auto ret = new GraphicAnalysis(parent);
|
||||
if (m_designer) ret->m_fakeGL = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QString GraphicAnalysisPlugin::name() const {
|
||||
return QLatin1String("GraphicAnalysis");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicAnalysisPlugin::group() const {
|
||||
return QLatin1String("Display Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon GraphicAnalysisPlugin::icon() const {
|
||||
return QIcon(":/icons/graphic.png");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicAnalysisPlugin::toolTip() const {
|
||||
return QLatin1String(""); // QLatin1String("Widget for display any math graphics with grid and navigation");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicAnalysisPlugin::whatsThis() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
bool GraphicAnalysisPlugin::isContainer() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString GraphicAnalysisPlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"GraphicAnalysis\" name=\"graphicAnalysis\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString GraphicAnalysisPlugin::includeFile() const {
|
||||
return QLatin1String("graphic_analysis.h");
|
||||
}
|
||||
40
libs/graphic_analysis/plugin/graphic_analysis_plugin.h
Normal file
40
libs/graphic_analysis/plugin/graphic_analysis_plugin.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef GRAPHIC_analysis_PLUGIN_H
|
||||
#define GRAPHIC_analysis_PLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class GraphicAnalysis;
|
||||
|
||||
|
||||
class GraphicAnalysisPlugin
|
||||
: public QObject
|
||||
, public QDesignerCustomWidgetInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
GraphicAnalysisPlugin(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, m_designer;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
17
libs/graphic_analysis/plugin/qad_graphic_analysis.cpp
Normal file
17
libs/graphic_analysis/plugin/qad_graphic_analysis.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "qad_graphic_analysis.h"
|
||||
|
||||
#include "graphic_analysis_plugin.h"
|
||||
|
||||
QADGraphicAnalysis::QADGraphicAnalysis(QObject * parent): QObject(parent) {
|
||||
m_widgets << new GraphicAnalysisPlugin(this);
|
||||
}
|
||||
|
||||
|
||||
QList<QDesignerCustomWidgetInterface *> QADGraphicAnalysis::customWidgets() const {
|
||||
return m_widgets;
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_EXPORT_PLUGIN2(qad_graphic_analysis_plugin, QADGraphicAnalysis)
|
||||
#endif
|
||||
24
libs/graphic_analysis/plugin/qad_graphic_analysis.h
Normal file
24
libs/graphic_analysis/plugin/qad_graphic_analysis.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef QAD_GRAPHIC_H
|
||||
#define QAD_GRAPHIC_H
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtDesigner/QtDesigner>
|
||||
|
||||
class QADGraphicAnalysis
|
||||
: public QObject
|
||||
, public QDesignerCustomWidgetCollectionInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "qad.graphic_analysis")
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit QADGraphicAnalysis(QObject * parent = 0);
|
||||
virtual QList<QDesignerCustomWidgetInterface *> customWidgets() const;
|
||||
|
||||
private:
|
||||
QList<QDesignerCustomWidgetInterface *> m_widgets;
|
||||
};
|
||||
|
||||
#endif // QAD_GRAPHIC_H
|
||||
Reference in New Issue
Block a user