diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-25 20:53:52 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-25 20:53:52 (GMT) |
commit | ccebbb663a1b21204057d8b799de3ddf1b63307e (patch) | |
tree | b166fa2adbe5d7ab807189b2eb84edb4b5c0facb /src | |
parent | 8deaf82914c5ec8da7bc49f913d03a3754e1af0c (diff) | |
parent | 68affbdc60b6cc48b6e7786ffffe2b7512cade64 (diff) | |
download | Qt-ccebbb663a1b21204057d8b799de3ddf1b63307e.zip Qt-ccebbb663a1b21204057d8b799de3ddf1b63307e.tar.gz Qt-ccebbb663a1b21204057d8b799de3ddf1b63307e.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
fix performance penalty in Win32MakefileGenerator::findHighestVersion
Allow QDial to wrap value when wrapping property is set.
QtScript variant conversion: Convert numbers to (u)int if applicable (reviewed by khansen)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qabstractslider_p.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/qdial.cpp | 15 | ||||
-rw-r--r-- | src/script/api/qscriptengine.cpp | 4 |
3 files changed, 19 insertions, 2 deletions
diff --git a/src/gui/widgets/qabstractslider_p.h b/src/gui/widgets/qabstractslider_p.h index 19d1fca..d044131 100644 --- a/src/gui/widgets/qabstractslider_p.h +++ b/src/gui/widgets/qabstractslider_p.h @@ -117,7 +117,7 @@ public: ; } - inline int bound(int val) const { return qMax(minimum, qMin(maximum, val)); } + virtual int bound(int val) const { return qMax(minimum, qMin(maximum, val)); } inline int overflowSafeAdd(int add) const { int newValue = value + add; diff --git a/src/gui/widgets/qdial.cpp b/src/gui/widgets/qdial.cpp index a8d739f..bca5019 100644 --- a/src/gui/widgets/qdial.cpp +++ b/src/gui/widgets/qdial.cpp @@ -83,6 +83,7 @@ public: int valueFromPoint(const QPoint &) const; double angle(const QPoint &, const QPoint &) const; void init(); + virtual int bound(int val) const; }; void QDialPrivate::init() @@ -97,6 +98,20 @@ void QDialPrivate::init() #endif } +int QDialPrivate::bound(int val) const +{ + if (wrapping) { + if ((val >= minimum) && (val <= maximum)) + return val; + val = minimum + ((val - minimum) % (maximum - minimum)); + if (val < minimum) + val += maximum - minimum; + return val; + } else { + return QAbstractSliderPrivate::bound(val); + } +} + /*! Initialize \a option with the values from this QDial. This method is useful for subclasses when they need a QStyleOptionSlider, but don't want diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 69abcad..1fcbd73 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -1744,7 +1744,9 @@ QVariant QScriptEnginePrivate::toVariant(JSC::ExecState *exec, JSC::JSValue valu else if (QScriptDeclarativeClass *dc = declarativeClass(value)) return dc->toVariant(declarativeObject(value)); return variantMapFromObject(exec, JSC::asObject(value)); - } else if (value.isNumber()) { + } else if (value.isInt32()) { + return QVariant(toInt32(exec, value)); + } else if (value.isDouble()) { return QVariant(toNumber(exec, value)); } else if (value.isString()) { return QVariant(toString(exec, value)); |