From 8e9d152f463e3fb3fa6e64f3822d28621a0aea4f Mon Sep 17 00:00:00 2001 From: Hugo Teso Date: Thu, 6 Apr 2017 13:23:43 +0200 Subject: [PATCH] Fixes #84 by moving cursor to pointer position on right-click --- src/widgets/memwidget/memorywidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widgets/memwidget/memorywidget.cpp b/src/widgets/memwidget/memorywidget.cpp index 72a2a1c0..c2eba6cb 100644 --- a/src/widgets/memwidget/memorywidget.cpp +++ b/src/widgets/memwidget/memorywidget.cpp @@ -859,6 +859,10 @@ void MemoryWidget::showDisasContextMenu(const QPoint &pt) QMenu *menu = ui->disasTextEdit_2->createStandardContextMenu(); QTextCursor cur = ui->disasTextEdit_2->textCursor(); + // Move cursor to mouse position to get proper function data + cur.setPosition(ui->disasTextEdit_2->cursorForPosition(pt).position(), QTextCursor::MoveAnchor); + ui->disasTextEdit_2->setTextCursor(cur); + if (cur.hasSelection()) { menu->addSeparator(); menu->addAction(ui->actionSend_to_Notepad);