diff options
| author | Remko Tronçon <git@el-tramo.be> | 2010-09-05 12:59:02 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2010-09-05 12:59:02 (GMT) |
| commit | 89f18c8af344fc94bb5cf19035c74385d1c9df9c (patch) | |
| tree | d215e1ad1267431ea10d511d6f429985b5bf2800 /Swift/QtUI/QtWebView.cpp | |
| parent | 5b974445a8ce78ca73bdfae9a8114857e4fc3d36 (diff) | |
| download | swift-89f18c8af344fc94bb5cf19035c74385d1c9df9c.zip swift-89f18c8af344fc94bb5cf19035c74385d1c9df9c.tar.bz2 | |
Added "Clear" context menu for chat log.
Resolves: #225
Diffstat (limited to 'Swift/QtUI/QtWebView.cpp')
| -rw-r--r-- | Swift/QtUI/QtWebView.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Swift/QtUI/QtWebView.cpp b/Swift/QtUI/QtWebView.cpp index 93ecc18..df8479d 100644 --- a/Swift/QtUI/QtWebView.cpp +++ b/Swift/QtUI/QtWebView.cpp | |||
| @@ -29,21 +29,22 @@ void QtWebView::keyPressEvent(QKeyEvent* event) { | |||
| 29 | event->count()); | 29 | event->count()); |
| 30 | QWebView::keyPressEvent(translatedEvent); | 30 | QWebView::keyPressEvent(translatedEvent); |
| 31 | delete translatedEvent; | 31 | delete translatedEvent; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | void QtWebView::dragEnterEvent(QDragEnterEvent *event) { | 34 | void QtWebView::dragEnterEvent(QDragEnterEvent*) { |
| 35 | 35 | ||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | void QtWebView::contextMenuEvent(QContextMenuEvent* ev) { | 38 | void QtWebView::contextMenuEvent(QContextMenuEvent* ev) { |
| 39 | QMenu menu(this); | ||
| 39 | QAction* copyLinkAction = pageAction(QWebPage::CopyLinkToClipboard); | 40 | QAction* copyLinkAction = pageAction(QWebPage::CopyLinkToClipboard); |
| 40 | if (copyLinkAction) { | 41 | if (copyLinkAction) { |
| 41 | QMenu menu(this); | ||
| 42 | menu.addAction(copyLinkAction); | 42 | menu.addAction(copyLinkAction); |
| 43 | menu.exec(ev->globalPos()); | ||
| 44 | } | 43 | } |
| 44 | menu.addAction("Clear", this, SIGNAL(clearRequested())); | ||
| 45 | menu.exec(ev->globalPos()); | ||
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | void QtWebView::focusInEvent(QFocusEvent* event) { | 48 | void QtWebView::focusInEvent(QFocusEvent* event) { |
| 48 | QWebView::focusInEvent(event); | 49 | QWebView::focusInEvent(event); |
| 49 | emit gotFocus(); | 50 | emit gotFocus(); |
Swift