From c92b6d0185a07c22c4fab24da4764c74cd6e53cf Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 1 Jun 2007 09:54:47 +0000 Subject: [PATCH] Porting to Qt 4 --- src/QDS/QDS_SpinBoxDbl.cxx | 24 ++++++++++++------------ src/QDS/QDS_SpinBoxDbl.h | 18 +++++++++--------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/QDS/QDS_SpinBoxDbl.cxx b/src/QDS/QDS_SpinBoxDbl.cxx index 81a59d51e..14fc48b2c 100644 --- a/src/QDS/QDS_SpinBoxDbl.cxx +++ b/src/QDS/QDS_SpinBoxDbl.cxx @@ -18,7 +18,7 @@ // #include "QDS_SpinBoxDbl.h" -#include +#include /* \class QDS_SpinBoxDbl @@ -63,7 +63,7 @@ QDS_SpinBoxDbl::~QDS_SpinBoxDbl() QString QDS_SpinBoxDbl::getString() const { QString res; - QtxDblSpinBox* sb = spinBox(); + QtxDoubleSpinBox* sb = spinBox(); if ( sb && !sb->isCleared() ) { bool hasFocus = sb->hasFocus(); @@ -101,9 +101,9 @@ void QDS_SpinBoxDbl::setString( const QString& txt ) \brief Get spin box widget. \return internal spin box widget. */ -QtxDblSpinBox* QDS_SpinBoxDbl::spinBox() const +QtxDoubleSpinBox* QDS_SpinBoxDbl::spinBox() const { - return ::qobject_cast( controlWidget() ); + return ::qobject_cast( controlWidget() ); } /*! @@ -113,7 +113,7 @@ QtxDblSpinBox* QDS_SpinBoxDbl::spinBox() const */ QWidget* QDS_SpinBoxDbl::createControl( QWidget* parent ) { - QtxDblSpinBox* aSpinBox = new QtxDblSpinBox( parent ); + QtxDoubleSpinBox* aSpinBox = new QtxDoubleSpinBox( parent ); aSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); connect( aSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged( double ) ) ); return aSpinBox; @@ -143,7 +143,7 @@ double QDS_SpinBoxDbl::step() const { double s = 0; if ( spinBox() ) - s = spinBox()->lineStep(); + s = spinBox()->singleStep(); return s; } @@ -154,7 +154,7 @@ double QDS_SpinBoxDbl::step() const void QDS_SpinBoxDbl::setStep( const double step ) { if ( spinBox() ) - spinBox()->setLineStep( step ); + spinBox()->setSingleStep( step ); } /*! @@ -168,7 +168,7 @@ void QDS_SpinBoxDbl::unitSystemChanged( const QString& system ) { QDS_Datum::unitSystemChanged( system ); - QtxDblSpinBox* sb = spinBox(); + QtxDoubleSpinBox* sb = spinBox(); if ( !sb ) return; @@ -186,9 +186,9 @@ void QDS_SpinBoxDbl::unitSystemChanged( const QString& system ) if ( !aDicItem.IsNull() ) aPreci = aDicItem->GetPrecision(); - sb->setPrecision( aPreci ); + sb->setDecimals( aPreci ); - sb->setLineStep( .1 ); - sb->setMinValue( minValue().isEmpty() ? -DBL_MAX : minValue().toDouble() ); - sb->setMaxValue( maxValue().isEmpty() ? DBL_MAX : maxValue().toDouble() ); + sb->setSingleStep( .1 ); + sb->setMinimum( minValue().isEmpty() ? -DBL_MAX : minValue().toDouble() ); + sb->setMaximum( maxValue().isEmpty() ? DBL_MAX : maxValue().toDouble() ); } diff --git a/src/QDS/QDS_SpinBoxDbl.h b/src/QDS/QDS_SpinBoxDbl.h index 362f75c7c..e801d6c5b 100644 --- a/src/QDS/QDS_SpinBoxDbl.h +++ b/src/QDS/QDS_SpinBoxDbl.h @@ -21,7 +21,7 @@ #include "QDS_Datum.h" -class QtxDblSpinBox; +class QtxDoubleSpinBox; class QDS_EXPORT QDS_SpinBoxDbl : public QDS_Datum { @@ -31,20 +31,20 @@ public: QDS_SpinBoxDbl( const QString&, QWidget* = 0, const int = All, const QString& = QString::null ); virtual ~QDS_SpinBoxDbl(); - double step() const; - void setStep( const double ); + double step() const; + void setStep( const double ); private slots: - void onValueChanged( double ); + void onValueChanged( double ); protected: - QtxDblSpinBox* spinBox() const; - virtual QWidget* createControl( QWidget* ); + QtxDoubleSpinBox* spinBox() const; + virtual QWidget* createControl( QWidget* ); - virtual QString getString() const; - virtual void setString( const QString& ); + virtual QString getString() const; + virtual void setString( const QString& ); - virtual void unitSystemChanged( const QString& ); + virtual void unitSystemChanged( const QString& ); }; #endif -- 2.39.2