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>
bb10
Olivier Goffart 2012-02-25 11:42:57 +01:00 committed by Qt by Nokia
parent 96cfca6151
commit ec739707d7
1 changed files with 3 additions and 2 deletions

View File

@ -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;