From de010d4c6cea36e0770c69b8b28718d4a5094c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sat, 2 Dec 2017 14:10:15 +0100 Subject: [PATCH] Seek on right click in DisassemblyWidget --- src/widgets/DisassemblyWidget.cpp | 10 ++++++++++ src/widgets/DisassemblyWidget.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index 7fe1ffd7..f3a41735 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -535,6 +535,16 @@ void DisassemblyTextEdit::keyPressEvent(QKeyEvent */*event*/) //QPlainTextEdit::keyPressEvent(event); } +void DisassemblyTextEdit::mousePressEvent(QMouseEvent *event) +{ + QPlainTextEdit::mousePressEvent(event); + + if (event->button() == Qt::RightButton) + { + setTextCursor(cursorForPosition(event->pos())); + } +} + void DisassemblyWidget::seekPrev() { Core()->seekPrev(); diff --git a/src/widgets/DisassemblyWidget.h b/src/widgets/DisassemblyWidget.h index 2113ee6d..b3f8577d 100644 --- a/src/widgets/DisassemblyWidget.h +++ b/src/widgets/DisassemblyWidget.h @@ -93,6 +93,7 @@ protected: bool viewportEvent(QEvent *event) override; void scrollContentsBy(int dx, int dy) override; void keyPressEvent(QKeyEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; private: bool lockScroll;