diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2012-02-25 11:42:57 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-27 12:49:33 +0100 |
commit | ec739707d70d6450a261f7dd4726380e59d403ef (patch) | |
tree | 73d787abd301f1387d7576010c4a43e2d3bd4c8a /src/gui/kernel | |
parent | 96cfca6151b674f0266e879013d69de826ce3311 (diff) |
Remove deprecated usage of QKeySequence from qguivariant
The implicit conversion operators are deprecated.
Change-Id: I0e94c0671413da1ab58c6c7b8bb31614e2696409
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguivariant.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 0492e48bee..50d3f0b7d1 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -236,7 +236,7 @@ static bool convert(const QVariant::Private *d, int 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, int 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; |