[Tools] add PrefQuantitySpinBox to designer plugins/widget/FreeCAD_widgets.vcxproj
as discussed here: https://forum.freecadweb.org/viewtopic.php?f=10&t=49315&p=422648#p422648
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -25,20 +25,20 @@
|
||||
#define GUI_CUSTOMWIDGETS_H
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QWidget>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QFontComboBox>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QListWidget>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QSpinBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QGroupBox>
|
||||
#include <QGridLayout>
|
||||
#include <QTreeWidget>
|
||||
#include <QFontComboBox>
|
||||
#include <QWidget>
|
||||
|
||||
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
|
||||
|
||||
@@ -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 "<ui language=\"c++\">\n"
|
||||
" <widget class=\"Gui::PrefQuantitySpinBox\" name=\"unitSpinBox\">\n"
|
||||
" </widget>\n"
|
||||
"</ui>";
|
||||
}
|
||||
QString name() const
|
||||
{
|
||||
return QLatin1String("Gui::PrefQuantitySpinBox");
|
||||
}
|
||||
};
|
||||
|
||||
/* XPM */
|
||||
static const char *iconview_pixmap[]={
|
||||
"22 22 10 1",
|
||||
@@ -1565,6 +1613,7 @@ QList<QDesignerCustomWidgetInterface *> CustomWidgetPlugin::customWidgets () con
|
||||
cw.append(new PrefDoubleSpinBoxPlugin);
|
||||
cw.append(new PrefFontBoxPlugin);
|
||||
cw.append(new PrefUnitSpinBoxPlugin);
|
||||
cw.append(new PrefQuantitySpinBoxPlugin);
|
||||
return cw;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user