From 49112c891bb84eee4083fdad4376cba60b0c7818 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Tue, 4 Sep 2012 15:01:54 +0200 Subject: [PATCH] Don't use string comparison to figure out how to use the clipboard Change-Id: I36738b3808ebed0d108882ebdc74ee7dd1899bfd Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qwidgettextcontrol.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 48f20616a2..7b887c0306 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -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