git-svn-id: svn://db.shs.com.ru/libs@334 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
69
qad/widgets/plugin/evalspinboxplugin.cpp
Normal file
69
qad/widgets/plugin/evalspinboxplugin.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "evalspinbox.h"
|
||||
#include "evalspinboxplugin.h"
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
|
||||
EvalSpinBoxPlugin::EvalSpinBoxPlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void EvalSpinBoxPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
|
||||
if (m_initialized)
|
||||
return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool EvalSpinBoxPlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * EvalSpinBoxPlugin::createWidget(QWidget * parent) {
|
||||
return new EvalSpinBox(parent);
|
||||
}
|
||||
|
||||
|
||||
QString EvalSpinBoxPlugin::name() const {
|
||||
return QLatin1String("EvalSpinBox");
|
||||
}
|
||||
|
||||
|
||||
QString EvalSpinBoxPlugin::group() const {
|
||||
return QLatin1String("Input Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon EvalSpinBoxPlugin::icon() const {
|
||||
return QIcon(":/icons/evalspinbox.png");
|
||||
}
|
||||
|
||||
|
||||
QString EvalSpinBoxPlugin::toolTip() const {
|
||||
return QLatin1String("Evaluation double SpinBox");
|
||||
}
|
||||
|
||||
|
||||
QString EvalSpinBoxPlugin::whatsThis() const {
|
||||
return QLatin1String("Evaluation double SpinBox");
|
||||
}
|
||||
|
||||
|
||||
bool EvalSpinBoxPlugin::isContainer() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString EvalSpinBoxPlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"EvalSpinBox\" name=\"evalSpin\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString EvalSpinBoxPlugin::includeFile() const {
|
||||
return QLatin1String("evalspinbox.h");
|
||||
}
|
||||
|
||||
36
qad/widgets/plugin/evalspinboxplugin.h
Normal file
36
qad/widgets/plugin/evalspinboxplugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef EVALSPINBOXPLUGIN_H
|
||||
#define EVALSPINBOXPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class EvalSpinBoxPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
EvalSpinBoxPlugin(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 // EVALSPINBOXPLUGIN_H
|
||||
@@ -13,9 +13,10 @@
|
||||
#include "qcodeeditplugin.h"
|
||||
#include "qvarianteditplugin.h"
|
||||
#include "qpiconfigplugin.h"
|
||||
#include "evalspinboxplugin.h"
|
||||
|
||||
QADWidgets::QADWidgets(QObject * parent): QObject(parent)
|
||||
{
|
||||
|
||||
QADWidgets::QADWidgets(QObject * parent): QObject(parent) {
|
||||
m_widgets.append(new SpinSliderPlugin(this));
|
||||
m_widgets.append(new ColorButtonPlugin(this));
|
||||
m_widgets.append(new CharDialogPlugin(this));
|
||||
@@ -30,6 +31,7 @@ QADWidgets::QADWidgets(QObject * parent): QObject(parent)
|
||||
m_widgets.append(new QCodeEditPlugin(this));
|
||||
m_widgets.append(new QVariantEditPlugin(this));
|
||||
m_widgets.append(new QPIConfigPlugin(this));
|
||||
m_widgets.append(new EvalSpinBoxPlugin(this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user