diff options
author | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-06-29 11:25:11 (GMT) |
---|---|---|
committer | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-06-29 12:27:38 (GMT) |
commit | 9733307cf64ec665cded191675a424b02c39ab38 (patch) | |
tree | 71c14e38581e2c2691d726b9859e2fe4207a7c98 /src/gui/widgets/qspinbox.cpp | |
parent | e873cbdec9098856df2c2b584cee73ea0c5563ff (diff) | |
parent | c026747724f8120e40831096dfcd1e241de72779 (diff) | |
download | Qt-9733307cf64ec665cded191675a424b02c39ab38.zip Qt-9733307cf64ec665cded191675a424b02c39ab38.tar.gz Qt-9733307cf64ec665cded191675a424b02c39ab38.tar.bz2 |
Merge commit 'master/master' into kinetic-graphicseffect
Conflicts:
src/gui/graphicsview/graphicsview.pri
src/gui/graphicsview/qgraphicsitem_p.h
src/gui/graphicsview/qgraphicsscene.cpp
src/gui/graphicsview/qgraphicsview.cpp
Diffstat (limited to 'src/gui/widgets/qspinbox.cpp')
-rw-r--r-- | src/gui/widgets/qspinbox.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp index f12946c..e069a21 100644 --- a/src/gui/widgets/qspinbox.cpp +++ b/src/gui/widgets/qspinbox.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -284,6 +284,9 @@ void QSpinBox::setPrefix(const QString &prefix) d->prefix = prefix; d->updateEdit(); + + d->cachedSizeHint = QSize(); + updateGeometry(); } /*! @@ -318,6 +321,9 @@ void QSpinBox::setSuffix(const QString &suffix) d->suffix = suffix; d->updateEdit(); + + d->cachedSizeHint = QSize(); + updateGeometry(); } /*! @@ -983,7 +989,7 @@ QVariant QSpinBoxPrivate::valueFromText(const QString &text) const bool QSpinBoxPrivate::isIntermediateValue(const QString &str) const { - const int num = q_func()->locale().toInt(str, 0, 10); + const int num = locale.toInt(str, 0, 10); const int min = minimum.toInt(); const int max = maximum.toInt(); @@ -1053,13 +1059,13 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, } else { bool ok = false; bool removedThousand = false; - num = q_func()->locale().toInt(copy, &ok, 10); + num = locale.toInt(copy, &ok, 10); if (!ok && copy.contains(thousand) && (max >= 1000 || min <= -1000)) { const int s = copy.size(); copy.remove(thousand); pos = qMax(0, pos - (s - copy.size())); removedThousand = true; - num = q_func()->locale().toInt(copy, &ok, 10); + num = locale.toInt(copy, &ok, 10); } QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num; if (!ok) { @@ -1346,9 +1352,8 @@ QVariant QDoubleSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, { bool ok = false; - QLocale loc(q_func()->locale()); - num = loc.toDouble(copy, &ok); - QSBDEBUG() << __FILE__ << __LINE__ << loc << copy << num << ok; + num = locale.toDouble(copy, &ok); + QSBDEBUG() << __FILE__ << __LINE__ << locale << copy << num << ok; bool notAcceptable = false; if (!ok) { @@ -1373,7 +1378,7 @@ QVariant QDoubleSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, pos = qMax(0, pos - (s - copy.size())); - num = loc.toDouble(copy, &ok); + num = locale.toDouble(copy, &ok); QSBDEBUG() << thousand << num << copy << ok; if (!ok) { |