diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-02-29 09:18:59 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-02-29 09:23:14 +1000 |
commit | 98dd1781d9256f68025d2a2db408f4f5947f3214 (patch) | |
tree | dbe1424abd90014edb5546c920ca585ed62b46e3 /src/gui/kernel/qguivariant.cpp | |
parent | 6c1bdc1854a7700c2b3a345b95f6a2fdca84037d (diff) | |
parent | fa1b9070af66edb81b2a3735c1951f78b22bd666 (diff) |
Merge master -> api_changes
Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac.
Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
Diffstat (limited to 'src/gui/kernel/qguivariant.cpp')
-rw-r--r-- | src/gui/kernel/qguivariant.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 8378650dcb..50d3f0b7d1 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -221,7 +221,7 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) return QMetaTypeSwitcher::switcher<bool>(comparator, a->type, 0); } -static bool convert(const QVariant::Private *d, QVariant::Type t, +static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) { switch (t) { @@ -236,7 +236,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, switch (d->type) { #ifndef QT_NO_SHORTCUT case QVariant::KeySequence: - *str = QString(*v_cast<QKeySequence>(d)); + *str = (*v_cast<QKeySequence>(d)).toString(QKeySequence::NativeText); return true; #endif case QVariant::Font: @@ -285,7 +285,8 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, #ifndef QT_NO_SHORTCUT case QVariant::Int: if (d->type == QVariant::KeySequence) { - *static_cast<int *>(result) = (int)(*(v_cast<QKeySequence>(d))); + const QKeySequence &seq = *v_cast<QKeySequence>(d); + *static_cast<int *>(result) = seq.isEmpty() ? 0 : seq[0]; return true; } break; @@ -342,7 +343,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, return qcoreVariantHandler()->convert(d, t, result, ok); } -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) static void streamDebug(QDebug dbg, const QVariant &v) { QVariant::Private *d = const_cast<QVariant::Private *>(&v.data_ptr()); @@ -362,7 +363,7 @@ const QVariant::Handler qt_gui_variant_handler = { compare, convert, 0, -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) streamDebug #else 0 |