OSDN Git Service

Handle missing copy shortcut.
authorkh <qtc-committer@nokia.com>
Mon, 27 Jul 2009 14:39:18 +0000 (16:39 +0200)
committerkh <qtc-committer@nokia.com>
Mon, 27 Jul 2009 14:39:18 +0000 (16:39 +0200)
Task-number: 257868
Reviewed-by: kh
src/shared/help/helpviewer.cpp
src/shared/help/helpviewer.h

index 701c632..df7ee33 100644 (file)
@@ -309,6 +309,17 @@ void HelpViewer::home()
     setSource(homepage);
 }
 
+// TODO: remove this once we support multiple keysequences per command
+void HelpViewer::keyPressEvent(QKeyEvent *e)
+{
+    if (e->key() == Qt::Key_Insert && e->modifiers() == Qt::CTRL) {
+        if (hasSelection())
+            copy();
+    }
+
+    QWebView::keyPressEvent(e);
+}
+
 void HelpViewer::wheelEvent(QWheelEvent *e)
 {
     if (e->modifiers() & Qt::ControlModifier) {
index fea0b2d..1838090 100644 (file)
@@ -105,7 +105,9 @@ Q_SIGNALS:
     void sourceChanged(const QUrl &);
 
 protected:
-    virtual void wheelEvent(QWheelEvent *);
+    void keyPressEvent(QKeyEvent *e);
+
+    void wheelEvent(QWheelEvent *e);
     void mouseReleaseEvent(QMouseEvent *e);
     void mousePressEvent(QMouseEvent *event);