add CircleIndicator
This commit is contained in:
69
libs/widgets/plugin/circleindicatorplugin.cpp
Normal file
69
libs/widgets/plugin/circleindicatorplugin.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "circleindicatorplugin.h"
|
||||
|
||||
#include "circleindicator.h"
|
||||
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
|
||||
CircleIndicatorPlugin::CircleIndicatorPlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void CircleIndicatorPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
|
||||
if (m_initialized) return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool CircleIndicatorPlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * CircleIndicatorPlugin::createWidget(QWidget * parent) {
|
||||
return new CircleIndicator(parent);
|
||||
}
|
||||
|
||||
|
||||
QString CircleIndicatorPlugin::name() const {
|
||||
return QLatin1String("CircleIndicator");
|
||||
}
|
||||
|
||||
|
||||
QString CircleIndicatorPlugin::group() const {
|
||||
return QLatin1String("Display Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon CircleIndicatorPlugin::icon() const {
|
||||
return QIcon(/*":/icons/clineedit.png"*/);
|
||||
}
|
||||
|
||||
|
||||
QString CircleIndicatorPlugin::toolTip() const {
|
||||
return QLatin1String("Circle indicator with text");
|
||||
}
|
||||
|
||||
|
||||
QString CircleIndicatorPlugin::whatsThis() const {
|
||||
return QLatin1String("Circle indicator with text");
|
||||
}
|
||||
|
||||
|
||||
bool CircleIndicatorPlugin::isContainer() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString CircleIndicatorPlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"CircleIndicator\" name=\"circleIndicator\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString CircleIndicatorPlugin::includeFile() const {
|
||||
return QLatin1String("circleindicator.h");
|
||||
}
|
||||
36
libs/widgets/plugin/circleindicatorplugin.h
Normal file
36
libs/widgets/plugin/circleindicatorplugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef circleindicatorplugin_H
|
||||
#define circleindicatorplugin_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class CircleIndicatorPlugin
|
||||
: public QObject
|
||||
, public QDesignerCustomWidgetInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
CircleIndicatorPlugin(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
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "qad_widgets.h"
|
||||
|
||||
#include "circleindicatorplugin.h"
|
||||
#include "clineeditplugin.h"
|
||||
#include "colorbuttonplugin.h"
|
||||
#include "ecomboboxplugin.h"
|
||||
@@ -21,24 +22,28 @@
|
||||
|
||||
|
||||
QADWidgets::QADWidgets(QObject * parent): QObject(parent) {
|
||||
m_widgets.append(new SpinSliderPlugin(this));
|
||||
m_widgets.append(new ColorButtonPlugin(this));
|
||||
m_widgets.append(new ShortcutsPlugin(this));
|
||||
m_widgets.append(new CLineEditPlugin(this));
|
||||
m_widgets.append(new QIPEditPlugin(this));
|
||||
m_widgets.append(new QPointEditPlugin(this));
|
||||
m_widgets.append(new QRectEditPlugin(this));
|
||||
m_widgets.append(new EComboBoxPlugin(this));
|
||||
m_widgets.append(new QPIConsolePlugin(this));
|
||||
m_widgets.append(new IconedLabelPlugin(this));
|
||||
m_widgets.append(new QCodeEditPlugin(this));
|
||||
m_widgets.append(new QVariantEditPlugin(this));
|
||||
m_widgets.append(new QPIConfigPlugin(this));
|
||||
m_widgets.append(new EvalSpinBoxPlugin(this));
|
||||
m_widgets.append(new ImageViewPlugin(this));
|
||||
m_widgets.append(new ScrollSpinBoxPlugin(this));
|
||||
m_widgets.append(new RangeSliderPlugin(this));
|
||||
m_widgets.append(new StateIconPlugin(this));
|
||||
// clang-format off
|
||||
m_widgets
|
||||
<< new SpinSliderPlugin(this)
|
||||
<< new ColorButtonPlugin(this)
|
||||
<< new ShortcutsPlugin(this)
|
||||
<< new CLineEditPlugin(this)
|
||||
<< new QIPEditPlugin(this)
|
||||
<< new QPointEditPlugin(this)
|
||||
<< new QRectEditPlugin(this)
|
||||
<< new EComboBoxPlugin(this)
|
||||
<< new QPIConsolePlugin(this)
|
||||
<< new IconedLabelPlugin(this)
|
||||
<< new QCodeEditPlugin(this)
|
||||
<< new QVariantEditPlugin(this)
|
||||
<< new QPIConfigPlugin(this)
|
||||
<< new EvalSpinBoxPlugin(this)
|
||||
<< new ImageViewPlugin(this)
|
||||
<< new ScrollSpinBoxPlugin(this)
|
||||
<< new RangeSliderPlugin(this)
|
||||
<< new StateIconPlugin(this)
|
||||
<< new CircleIndicatorPlugin(this);
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user