Skip to content

Commit

Permalink
keyboardTracking property added to doubleSpinBox, constructor made ex…
Browse files Browse the repository at this point in the history
…plicit, destructor added
  • Loading branch information
Marc Gronle committed Jun 14, 2016
1 parent b9a1e15 commit 13f3c4d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
5 changes: 3 additions & 2 deletions common/addInInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ static const char* ito_AddInInterface_OldVersions[] = {
"ito.AddIn.InterfaceBase/2.0.0", //outdated on 2015-12-04 due to improvements in plot/figure interfaces, removal of deprecated classes helperActuator and helperGrabber and further removal of deprecated items
"ito.AddIn.InterfaceBase/2.1.0", //outdated on 2016-02-01 due to improvements in PluginThreadCtrl, ActuatorThreadCtrl and DataIoThreadCtrl (as replacement for removed classes helperActuator and helperGrabber), new method ito::DataObject::getStep and some smaller rearrangements
"ito.AddIn.InterfaceBase/2.2.0", //outdated on 2016-02-19 due to crash fixes if the main mindow is deleted and implicitely closes dock widgets of plugins, that are currently blocked by any other operation.
"ito.AddIn.InterfaceBase/2.3.0", //outdated on 2016-06-14 due to changes in signal definitions in plots, introduction of complex and complexArray types in ParamBase and further smaller changes.
NULL
};

Expand All @@ -1079,10 +1080,10 @@ static const char* ito_AddInInterface_OldVersions[] = {
#define CREATE_ADDININTERFACE_VERSION(major,minor,patch) ((major<<16)|(minor<<8)|(patch))

#define ITOM_ADDININTERFACE_MAJOR 2
#define ITOM_ADDININTERFACE_MINOR 3
#define ITOM_ADDININTERFACE_MINOR 4
#define ITOM_ADDININTERFACE_PATCH 0
#define ITOM_ADDININTERFACE_VERSION CREATE_ADDININTERFACE_VERSION(ITOM_ADDININTERFACE_MAJOR,ITOM_ADDININTERFACE_MINOR,ITOM_ADDININTERFACE_PATCH)
static const char* ito_AddInInterface_CurrentVersion = CREATE_ADDININTERFACE_VERSION_STR(2,3,0); //results in "ito.AddIn.InterfaceBase/x.x.x"; (the numbers 1,3,1 can not be replaced by the macros above. Does not work properly)
static const char* ito_AddInInterface_CurrentVersion = CREATE_ADDININTERFACE_VERSION_STR(2,4,0); //results in "ito.AddIn.InterfaceBase/x.x.x"; (the numbers 1,3,1 can not be replaced by the macros above. Does not work properly)



Expand Down
23 changes: 18 additions & 5 deletions itomWidgets/doubleSpinBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,10 @@ DoubleSpinBox::DoubleSpinBox(DoubleSpinBox::SetMode mode, QWidget* newParent)
this->setSetMode(mode);
}

//TODO: uncomment this if the addinInterface is increment for the next time. (30.03.2016, M. Gronle)
////-----------------------------------------------------------------------------
//DoubleSpinBox::~DoubleSpinBox()
//{
//}
//-----------------------------------------------------------------------------
DoubleSpinBox::~DoubleSpinBox()
{
}

//-----------------------------------------------------------------------------
double DoubleSpinBox::value() const
Expand Down Expand Up @@ -861,6 +860,20 @@ double DoubleSpinBox::round(double value) const
return QString::number(value, 'f', d->SpinBox->decimals()).toDouble();
}

//-----------------------------------------------------------------------------
void DoubleSpinBox::setKeyboardTracking(bool kt)
{
Q_D(const DoubleSpinBox);
d->SpinBox->setKeyboardTracking(kt);
}

//-----------------------------------------------------------------------------
bool DoubleSpinBox::keyboardTracking() const
{
Q_D(const DoubleSpinBox);
return d->SpinBox->keyboardTracking();
}

//-----------------------------------------------------------------------------
QDoubleSpinBox* DoubleSpinBox::spinBox() const
{
Expand Down
13 changes: 7 additions & 6 deletions itomWidgets/doubleSpinBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class ITOMWIDGETS_EXPORT DoubleSpinBox : public QWidget
/// SizeHintByMinMax by default
/// SizeHintPolicy, sizeHintPolicy(), setSizeHintPolicy()
Q_PROPERTY(SizeHintPolicy sizeHintPolicy READ sizeHintPolicy WRITE setSizeHintPolicy)
/// This property wraps the keyboardTracking property of the underlying spinbox.
Q_PROPERTY(bool keyboardTracking READ keyboardTracking WRITE setKeyboardTracking)

public:

Expand Down Expand Up @@ -170,13 +172,9 @@ class ITOMWIDGETS_EXPORT DoubleSpinBox : public QWidget

/// Constructor, creates a DoubleSpinBox. The look and feel
/// are the same as of a QDoubleSpinBox
DoubleSpinBox(QWidget* parent = 0);
DoubleSpinBox(DoubleSpinBox::SetMode mode, QWidget* parent = 0);

//TODO: uncomment this if the addinInterface is increment for the next time and remove the two constructors above. (30.03.2016, M. Gronle)
/*explicit DoubleSpinBox(QWidget* parent = 0);
explicit DoubleSpinBox(QWidget* parent = 0);
explicit DoubleSpinBox(DoubleSpinBox::SetMode mode, QWidget* parent = 0);
virtual ~DoubleSpinBox();*/
virtual ~DoubleSpinBox();

/// Get the spinbox current value
/// \sa setValue(), cleanText()
Expand Down Expand Up @@ -297,6 +295,9 @@ class ITOMWIDGETS_EXPORT DoubleSpinBox : public QWidget
/// \sa sizeHintPolicy
virtual QSize minimumSizeHint()const;

void setKeyboardTracking(bool kt);
bool keyboardTracking() const;

public slots:
/// Set the value of the spinbox following the current mode.
/// \sa setMode(), value(), setValueIfDifferent(), setValueAlways()
Expand Down
4 changes: 2 additions & 2 deletions itomWidgets/pluginVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

#define ITOM_WIDGETS_VERSION_MAJOR 1
#define ITOM_WIDGETS_VERSION_MINOR 2
#define ITOM_WIDGETS_VERSION_PATCH 1
#define ITOM_WIDGETS_VERSION_PATCH 2
#define ITOM_WIDGETS_VERSION_REVISION 0
#define ITOM_WIDGETS_VERSION_PATCH_SMALL 0
#define ITOM_WIDGETS_VERSION_STRING "1.2.1"
#define ITOM_WIDGETS_VERSION_STRING "1.2.2"
#define ITOM_WIDGETS_COMPANY "Institut fuer Technische Optik, University Stuttgart"
#define ITOM_WIDGETS_COPYRIGHT "(C) 2016, ITO, University Stuttgart"
#define ITOM_WIDGETS_NAME "itomWidgets"
Expand Down

0 comments on commit 13f3c4d

Please sign in to comment.