Don't use string comparison to figure out how to use the clipboard

Change-Id: I36738b3808ebed0d108882ebdc74ee7dd1899bfd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Jorgen Lind 2012-09-04 15:01:54 +02:00 committed by Qt by Nokia
parent 0eb3d74386
commit 49112c891b

View File

@ -1271,9 +1271,10 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e)
}
else if (e == QKeySequence::Paste) {
QClipboard::Mode mode = QClipboard::Clipboard;
if (QGuiApplication::platformName() == QLatin1String("xcb"))
if (e->modifiers() == (Qt::CTRL | Qt::SHIFT) && e->key() == Qt::Key_Insert)
mode = QClipboard::Selection;
if (QGuiApplication::clipboard()->supportsSelection()) {
if (e->modifiers() == (Qt::CTRL | Qt::SHIFT) && e->key() == Qt::Key_Insert)
mode = QClipboard::Selection;
}
q->paste(mode);
}
#endif