Fixes #84 by moving cursor to pointer position on right-click

This commit is contained in:
Hugo Teso 2017-04-06 13:23:43 +02:00
parent ba8f60fe56
commit 8e9d152f46

View File

@ -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);