diff --git a/src/Tools/plugins/widget/customwidgets.cpp b/src/Tools/plugins/widget/customwidgets.cpp index 78145f9e80..8952dc46d2 100644 --- a/src/Tools/plugins/widget/customwidgets.cpp +++ b/src/Tools/plugins/widget/customwidgets.cpp @@ -658,6 +658,37 @@ void PrefUnitSpinBox::setParamGrpPath ( const QByteArray& name ) // -------------------------------------------------------------------- +PrefQuantitySpinBox::PrefQuantitySpinBox(QWidget* parent) + : QuantitySpinBox(parent) +{ +} + +PrefQuantitySpinBox::~PrefQuantitySpinBox() +{ +} + +QByteArray PrefQuantitySpinBox::entryName() const +{ + return m_sPrefName; +} + +QByteArray PrefQuantitySpinBox::paramGrpPath() const +{ + return m_sPrefGrp; +} + +void PrefQuantitySpinBox::setEntryName(const QByteArray& name) +{ + m_sPrefName = name; +} + +void PrefQuantitySpinBox::setParamGrpPath(const QByteArray& name) +{ + m_sPrefGrp = name; +} + +// -------------------------------------------------------------------- + CommandIconView::CommandIconView ( QWidget * parent ) : QListWidget(parent) { diff --git a/src/Tools/plugins/widget/customwidgets.h b/src/Tools/plugins/widget/customwidgets.h index 3abbe31b1a..d9c69b3795 100644 --- a/src/Tools/plugins/widget/customwidgets.h +++ b/src/Tools/plugins/widget/customwidgets.h @@ -25,20 +25,20 @@ #define GUI_CUSTOMWIDGETS_H #include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include +#include namespace Base { class Quantity{}; @@ -325,6 +325,29 @@ private: // ------------------------------------------------------------------------------ +class PrefQuantitySpinBox : public QuantitySpinBox +{ + Q_OBJECT + + Q_PROPERTY(QByteArray prefEntry READ entryName WRITE setEntryName) + Q_PROPERTY(QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath) + +public: + PrefQuantitySpinBox(QWidget* parent = 0); + virtual ~PrefQuantitySpinBox(); + + QByteArray entryName() const; + QByteArray paramGrpPath() const; + void setEntryName(const QByteArray& name); + void setParamGrpPath(const QByteArray& name); + +private: + QByteArray m_sPrefName; + QByteArray m_sPrefGrp; +}; + +// ------------------------------------------------------------------------------ + class CommandIconView : public QListWidget { Q_OBJECT diff --git a/src/Tools/plugins/widget/plugin.cpp b/src/Tools/plugins/widget/plugin.cpp index fde9909747..0937f0d7e1 100644 --- a/src/Tools/plugins/widget/plugin.cpp +++ b/src/Tools/plugins/widget/plugin.cpp @@ -667,6 +667,54 @@ public: } }; +class PrefQuantitySpinBoxPlugin : public QDesignerCustomWidgetInterface +{ + Q_INTERFACES(QDesignerCustomWidgetInterface) +public: + PrefQuantitySpinBoxPlugin() + { + } + QWidget* createWidget(QWidget* parent) + { + return new Gui::PrefQuantitySpinBox(parent); + } + QString group() const + { + return QLatin1String("Preference Widgets"); + } + QIcon icon() const + { + return QIcon(QPixmap(quantityspinbox_pixmap)); + } + QString includeFile() const + { + return QLatin1String("Gui/PrefWidgets.h"); + } + QString toolTip() const + { + return QLatin1String("Preference Quantity Spin Box"); + } + QString whatsThis() const + { + return QLatin1String("Preference Quantity Spin Box Widget."); + } + bool isContainer() const + { + return false; + } + QString domXml() const + { + return "\n" + " \n" + " \n" + ""; + } + QString name() const + { + return QLatin1String("Gui::PrefQuantitySpinBox"); + } +}; + /* XPM */ static const char *iconview_pixmap[]={ "22 22 10 1", @@ -1565,6 +1613,7 @@ QList CustomWidgetPlugin::customWidgets () con cw.append(new PrefDoubleSpinBoxPlugin); cw.append(new PrefFontBoxPlugin); cw.append(new PrefUnitSpinBoxPlugin); + cw.append(new PrefQuantitySpinBoxPlugin); return cw; }