plugin: [skip ci] add custom widgets Gui::IntSpinBox and Gui::DoubleSpinBox

This commit is contained in:
wmayer
2020-08-12 11:38:31 +02:00
parent 0811c61435
commit 93bb9646c3
3 changed files with 143 additions and 0 deletions

View File

@@ -1626,6 +1626,18 @@ void UIntSpinBox::updateValidator()
// --------------------------------------------------------------------
IntSpinBox::IntSpinBox(QWidget* parent)
: QSpinBox(parent)
{
}
IntSpinBox::~IntSpinBox()
{
}
// --------------------------------------------------------------------
PrefSpinBox::PrefSpinBox ( QWidget * parent )
: QSpinBox(parent)
{
@@ -1657,6 +1669,17 @@ void PrefSpinBox::setParamGrpPath ( const QByteArray& name )
// --------------------------------------------------------------------
DoubleSpinBox::DoubleSpinBox(QWidget* parent)
: QDoubleSpinBox(parent)
{
}
DoubleSpinBox::~DoubleSpinBox()
{
}
// --------------------------------------------------------------------
PrefDoubleSpinBox::PrefDoubleSpinBox ( QWidget * parent )
: QDoubleSpinBox(parent)
{

View File

@@ -597,6 +597,28 @@ private:
UIntSpinBoxPrivate * d;
};
// ------------------------------------------------------------------------------
class IntSpinBox : public QSpinBox
{
Q_OBJECT
public:
IntSpinBox ( QWidget* parent=0 );
virtual ~IntSpinBox();
};
// ------------------------------------------------------------------------------
class DoubleSpinBox : public QDoubleSpinBox
{
Q_OBJECT
public:
DoubleSpinBox ( QWidget* parent=0 );
virtual ~DoubleSpinBox();
};
// -------------------------------------------------------------
class PrefSpinBox : public QSpinBox

View File

@@ -879,6 +879,102 @@ public:
}
};
class IntSpinBoxPlugin : public QDesignerCustomWidgetInterface
{
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
IntSpinBoxPlugin()
{
}
QWidget *createWidget(QWidget *parent)
{
return new Gui::IntSpinBox(parent);
}
QString group() const
{
return QLatin1String("Input Widgets");
}
QIcon icon() const
{
return QIcon( QPixmap( spinbox_pixmap ) );
}
QString includeFile() const
{
return QLatin1String("Gui/SpinBox.h");
}
QString toolTip() const
{
return QLatin1String("Spin Box");
}
QString whatsThis() const
{
return QLatin1String("Spin box widget (spin button).");
}
bool isContainer() const
{
return false;
}
QString domXml() const
{
return "<ui language=\"c++\">\n"
" <widget class=\"Gui::IntSpinBox\" name=\"intSpinBox\">\n"
" </widget>\n"
"</ui>";
}
QString name() const
{
return QLatin1String("Gui::IntSpinBox");
}
};
class DoubleSpinBoxPlugin : public QDesignerCustomWidgetInterface
{
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
DoubleSpinBoxPlugin()
{
}
QWidget *createWidget(QWidget *parent)
{
return new Gui::DoubleSpinBox(parent);
}
QString group() const
{
return QLatin1String("Input Widgets");
}
QIcon icon() const
{
return QIcon( QPixmap( spinbox_pixmap ) );
}
QString includeFile() const
{
return QLatin1String("Gui/SpinBox.h");
}
QString toolTip() const
{
return QLatin1String("Double Spin Box");
}
QString whatsThis() const
{
return QLatin1String("Spin box widget (spin button).");
}
bool isContainer() const
{
return false;
}
QString domXml() const
{
return "<ui language=\"c++\">\n"
" <widget class=\"Gui::DoubleSpinBox\" name=\"doubleSpinBox\">\n"
" </widget>\n"
"</ui>";
}
QString name() const
{
return QLatin1String("Gui::DoubleSpinBox");
}
};
class PrefSpinBoxPlugin : public QDesignerCustomWidgetInterface
{
Q_INTERFACES(QDesignerCustomWidgetInterface)
@@ -1601,6 +1697,8 @@ QList<QDesignerCustomWidgetInterface *> CustomWidgetPlugin::customWidgets () con
cw.append(new QuantitySpinBoxPlugin);
cw.append(new CommandIconViewPlugin);
cw.append(new UIntSpinBoxPlugin);
cw.append(new IntSpinBoxPlugin);
cw.append(new DoubleSpinBoxPlugin);
cw.append(new ColorButtonPlugin);
cw.append(new PrefFileChooserPlugin);
cw.append(new PrefSpinBoxPlugin);