summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-08-20 17:09:23 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-20 17:09:23 (GMT)
commit6272731f996ce48ed405bb5eb1b53ebfdbeea08a (patch)
treee0e5aca636736fa830073780e2ba566fa2ab8aff /Swift/QtUI/QtWebView.cpp
parent84835e9ed81d215511a0393d371ff9bf3ddf4953 (diff)
downloadswift-6272731f996ce48ed405bb5eb1b53ebfdbeea08a.zip
swift-6272731f996ce48ed405bb5eb1b53ebfdbeea08a.tar.bz2
Disable dropping of images & URL context menus in the chat view.
Diffstat (limited to 'Swift/QtUI/QtWebView.cpp')
-rw-r--r--Swift/QtUI/QtWebView.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Swift/QtUI/QtWebView.cpp b/Swift/QtUI/QtWebView.cpp
index a97357d..93ecc18 100644
--- a/Swift/QtUI/QtWebView.cpp
+++ b/Swift/QtUI/QtWebView.cpp
@@ -9,10 +9,10 @@
#include <QKeyEvent>
#include <QFocusEvent>
+#include <QMenu>
namespace Swift {
QtWebView::QtWebView(QWidget* parent) : QWebView(parent) {
-
}
void QtWebView::keyPressEvent(QKeyEvent* event) {
@@ -31,6 +31,19 @@ void QtWebView::keyPressEvent(QKeyEvent* event) {
delete translatedEvent;
}
+void QtWebView::dragEnterEvent(QDragEnterEvent *event) {
+
+}
+
+void QtWebView::contextMenuEvent(QContextMenuEvent* ev) {
+ QAction* copyLinkAction = pageAction(QWebPage::CopyLinkToClipboard);
+ if (copyLinkAction) {
+ QMenu menu(this);
+ menu.addAction(copyLinkAction);
+ menu.exec(ev->globalPos());
+ }
+}
+
void QtWebView::focusInEvent(QFocusEvent* event) {
QWebView::focusInEvent(event);
emit gotFocus();