From ec739707d70d6450a261f7dd4726380e59d403ef Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 25 Feb 2012 11:42:57 +0100 Subject: Remove deprecated usage of QKeySequence from qguivariant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The implicit conversion operators are deprecated. Change-Id: I0e94c0671413da1ab58c6c7b8bb31614e2696409 Reviewed-by: Jędrzej Nowacki --- src/gui/kernel/qguivariant.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qguivariant.cpp') 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(d)); + *str = (*v_cast(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(result) = (int)(*(v_cast(d))); + const QKeySequence &seq = *v_cast(d); + *static_cast(result) = seq.isEmpty() ? 0 : seq[0]; return true; } break; -- cgit v1.2.3