diff --git a/api/debugadaptertype.cpp b/api/debugadaptertype.cpp index 5d27554f..220040d2 100644 --- a/api/debugadaptertype.cpp +++ b/api/debugadaptertype.cpp @@ -21,7 +21,7 @@ using namespace BinaryNinjaDebuggerAPI; using namespace std; -DebugAdapterType* DebugAdapterType::GetByName(const std::string& name) +DbgRef DebugAdapterType::GetByName(const std::string& name) { BNDebugAdapterType* adapter = BNGetDebugAdapterTypeByName(name.c_str()); if (!adapter) diff --git a/api/debuggerapi.h b/api/debuggerapi.h index 6fbaf67b..023c4811 100644 --- a/api/debuggerapi.h +++ b/api/debuggerapi.h @@ -890,7 +890,7 @@ namespace BinaryNinjaDebuggerAPI { { public: DebugAdapterType(BNDebugAdapterType* adapterType); - static DebugAdapterType* GetByName(const std::string& name); + static DbgRef GetByName(const std::string& name); bool CanExecute(Ref data); bool CanConnect(Ref data); static std::vector GetAvailableAdapters(Ref data); diff --git a/ui/attachprocess.cpp b/ui/attachprocess.cpp index 23dfd429..da6e7365 100644 --- a/ui/attachprocess.cpp +++ b/ui/attachprocess.cpp @@ -281,7 +281,7 @@ bool ProcessListFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIn void ProcessListWidget::contextMenuEvent(QContextMenuEvent* event) { - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } @@ -319,11 +319,10 @@ ProcessListWidget::ProcessListWidget(QWidget* parent, DbgRef m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); - m_menu = new Menu(); QString actionName = QString::fromStdString("Refresh"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST); + m_menu.addAction(actionName, "Options", MENU_ORDER_FIRST); m_actionHandler.bindAction(actionName, UIAction([this]() { updateContent(); })); // TODO: context menu copy diff --git a/ui/attachprocess.h b/ui/attachprocess.h index d23ad499..379631fd 100644 --- a/ui/attachprocess.h +++ b/ui/attachprocess.h @@ -130,7 +130,7 @@ class ProcessListWidget : public QTableView, public FilterTarget UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; - Menu* m_menu; + Menu m_menu; virtual void contextMenuEvent(QContextMenuEvent* event) override; diff --git a/ui/breakpointswidget.cpp b/ui/breakpointswidget.cpp index c0a58186..97be7db3 100644 --- a/ui/breakpointswidget.cpp +++ b/ui/breakpointswidget.cpp @@ -29,6 +29,7 @@ limitations under the License. #include #include #include "breakpointswidget.h" +#include "base/assertions.h" #include "hardwarebreakpointdialog.h" #include "ui.h" #include "menus.h" @@ -378,9 +379,8 @@ DebugBreakpointsWidget::DebugBreakpointsWidget(ViewFrame* view, BinaryViewRef da m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); + BN_RELEASE_ASSERT(menu != nullptr); m_menu = menu; - if (m_menu == nullptr) - m_menu = new Menu(); QString removeBreakpointActionName = QString::fromStdString("Remove Breakpoint"); UIAction::registerAction(removeBreakpointActionName, QKeySequence::Delete); diff --git a/ui/debuggerinfowidget.cpp b/ui/debuggerinfowidget.cpp index ed1ca4f5..c2ab9d82 100644 --- a/ui/debuggerinfowidget.cpp +++ b/ui/debuggerinfowidget.cpp @@ -682,7 +682,7 @@ void DebugInfoSidebarWidget::notifyFontChanged() } -DebuggerInfoEntryItemDelegate::DebuggerInfoEntryItemDelegate(QWidget* parent): m_render(parent) +DebuggerInfoEntryItemDelegate::DebuggerInfoEntryItemDelegate(QWidget* parent): QStyledItemDelegate(parent), m_render(parent) { updateFonts(); } diff --git a/ui/moduleswidget.cpp b/ui/moduleswidget.cpp index 71931bfe..28c77e32 100644 --- a/ui/moduleswidget.cpp +++ b/ui/moduleswidget.cpp @@ -296,19 +296,18 @@ DebugModulesWidget::DebugModulesWidget(ViewFrame* view, BinaryViewRef data) : QT m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); - m_menu = new Menu(); QString actionName = QString::fromStdString("Jump To Start"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST); + m_menu.addAction(actionName, "Options", MENU_ORDER_FIRST); m_actionHandler.bindAction(actionName, UIAction([this]() { jumpToStart(); })); actionName = QString::fromStdString("Jump To End"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST); + m_menu.addAction(actionName, "Options", MENU_ORDER_FIRST); m_actionHandler.bindAction(actionName, UIAction([this]() { jumpToEnd(); })); - m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return canCopy(); })); m_actionHandler.setActionDisplayName("Copy", [&]() { QModelIndexList sel = selectionModel()->selectedIndexes(); @@ -333,7 +332,7 @@ DebugModulesWidget::DebugModulesWidget(ViewFrame* view, BinaryViewRef data) : QT }); UIAction::registerAction("Copy All"); - m_menu->addAction("Copy All", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy All", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy All", UIAction([&]() { copyAll(); }, [&]() { return canCopyAll(); })); connect(this, &QTableView::doubleClicked, this, &DebugModulesWidget::onDoubleClicked); @@ -404,7 +403,7 @@ void DebugModulesWidget::contextMenuEvent(QContextMenuEvent* event) void DebugModulesWidget::showContextMenu() { - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } diff --git a/ui/moduleswidget.h b/ui/moduleswidget.h index 84fc7857..c88b06c6 100644 --- a/ui/moduleswidget.h +++ b/ui/moduleswidget.h @@ -148,7 +148,7 @@ class DebugModulesWidget : public QTableView, public FilterTarget UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; - Menu* m_menu; + Menu m_menu; virtual void contextMenuEvent(QContextMenuEvent* event) override; diff --git a/ui/registerswidget.cpp b/ui/registerswidget.cpp index d1a02d1e..2462446a 100644 --- a/ui/registerswidget.cpp +++ b/ui/registerswidget.cpp @@ -25,6 +25,7 @@ limitations under the License. #include "util.h" #include "clickablelabel.h" #include "registerswidget.h" +#include "base/assertions.h" using namespace BinaryNinja; using namespace std; @@ -450,9 +451,8 @@ DebugRegistersWidget::DebugRegistersWidget(ViewFrame* view, BinaryViewRef data, m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); + BN_RELEASE_ASSERT(menu != nullptr); m_menu = menu; - if (m_menu == nullptr) - m_menu = new Menu(); QString actionName = QString::fromStdString("Set to Zero"); UIAction::registerAction(actionName); diff --git a/ui/threadframes.cpp b/ui/threadframes.cpp index b3db9827..536c7e56 100644 --- a/ui/threadframes.cpp +++ b/ui/threadframes.cpp @@ -400,7 +400,7 @@ QSize ThreadFramesItemDelegate::sizeHint(const QStyleOptionViewItem& option, con void ThreadFramesWidget::contextMenuEvent(QContextMenuEvent* event) { - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } void ThreadFramesWidget::makeItSoloThread() @@ -675,27 +675,26 @@ ThreadFramesWidget::ThreadFramesWidget(QWidget* parent, ViewFrame* frame, Binary m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); - m_menu = new Menu(); QString actionName = QString::fromStdString("Suspend Thread"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST); + m_menu.addAction(actionName, "Options", MENU_ORDER_FIRST); m_actionHandler.bindAction( actionName, UIAction([this]() { suspendThread(); }, [this]() { return canSuspendOrResume(); })); actionName = QString::fromStdString("Resume Thread"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST); + m_menu.addAction(actionName, "Options", MENU_ORDER_FIRST); m_actionHandler.bindAction( actionName, UIAction([this]() { resumeThread(); }, [this]() { return canSuspendOrResume(); })); actionName = QString::fromStdString("Make It Solo Thread"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST); + m_menu.addAction(actionName, "Options", MENU_ORDER_FIRST); m_actionHandler.bindAction( actionName, UIAction([this]() { makeItSoloThread(); }, [this]() { return canSuspendOrResume(); })); - m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return selectionNotEmpty(); })); m_actionHandler.setActionDisplayName("Copy", [&]() { QModelIndexList sel = selectionModel()->selectedIndexes(); @@ -727,13 +726,13 @@ ThreadFramesWidget::ThreadFramesWidget(QWidget* parent, ViewFrame* frame, Binary actionName = QString::fromStdString("Copy Current Stack Trace"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_NORMAL); + m_menu.addAction(actionName, "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction( actionName, UIAction([this]() { copyCurrentFrame(); }, [this]() { return selectionNotEmpty(); })); actionName = QString::fromStdString("Copy All Stack Traces"); UIAction::registerAction(actionName); - m_menu->addAction(actionName, "Options", MENU_ORDER_NORMAL); + m_menu.addAction(actionName, "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction(actionName, UIAction([this]() { copyAllFrames(); })); // TODO: set as active thread action? diff --git a/ui/threadframes.h b/ui/threadframes.h index 54ac195d..4d5423d4 100644 --- a/ui/threadframes.h +++ b/ui/threadframes.h @@ -169,7 +169,7 @@ class ThreadFramesWidget : public QTreeView UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; - Menu* m_menu; + Menu m_menu; size_t m_debuggerEventCallback; diff --git a/ui/ttdbookmarkwidget.cpp b/ui/ttdbookmarkwidget.cpp index 9d53881b..28f28ff6 100644 --- a/ui/ttdbookmarkwidget.cpp +++ b/ui/ttdbookmarkwidget.cpp @@ -147,29 +147,28 @@ void TTDBookmarkWidget::setupUIActions() { m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); - m_menu = new Menu(); - m_menu->addAction("Add TTD Bookmark...", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Add TTD Bookmark...", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Add TTD Bookmark...", UIAction([&]() { addBookmarkFromDialog(); })); - m_menu->addAction("Bookmark Current Position", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Bookmark Current Position", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Bookmark Current Position", UIAction([&]() { addBookmarkFromCurrentPosition(); })); - m_menu->addAction("Edit Bookmark...", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Edit Bookmark...", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Edit Bookmark...", UIAction([&]() { editSelectedBookmark(); }, [&]() { return m_resultsTable->selectionModel()->hasSelection(); })); - m_menu->addAction("Remove Bookmark", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Remove Bookmark", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Remove Bookmark", UIAction([&]() { removeSelectedBookmark(); }, [&]() { return m_resultsTable->selectionModel()->hasSelection(); })); - m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Row", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Row", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy Row", UIAction([&]() { copySelectedRow(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Table", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Table", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy Table", UIAction([&]() { copyEntireTable(); }, [&]() { return m_resultsTable->rowCount() > 0; })); } @@ -324,13 +323,13 @@ void TTDBookmarkWidget::navigateToPendingViewAddress() void TTDBookmarkWidget::contextMenuEvent(QContextMenuEvent* event) { if (m_contextMenuManager) - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } void TTDBookmarkWidget::showContextMenu(const QPoint& position) { if (m_contextMenuManager) - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } void TTDBookmarkWidget::addBookmarkFromDialog() diff --git a/ui/ttdbookmarkwidget.h b/ui/ttdbookmarkwidget.h index 2bd67b18..a1a1e67e 100644 --- a/ui/ttdbookmarkwidget.h +++ b/ui/ttdbookmarkwidget.h @@ -85,7 +85,7 @@ class TTDBookmarkWidget : public QWidget UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; - Menu* m_menu; + Menu m_menu; std::vector m_bookmarks; uint64_t m_pendingViewAddress = 0; diff --git a/ui/ttdcallswidget.cpp b/ui/ttdcallswidget.cpp index 4fff7e6f..2ad30a1f 100644 --- a/ui/ttdcallswidget.cpp +++ b/ui/ttdcallswidget.cpp @@ -170,26 +170,25 @@ void TTDCallsQueryWidget::setupUIActions() { m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); - m_menu = new Menu(); // Add Copy action with Ctrl+C support - m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Row", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Row", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy Row", UIAction([&]() { copySelectedRow(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Table", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Table", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction( "Copy Table", UIAction([&]() { copyEntireTable(); }, [&]() { return m_resultsTable->rowCount() > 0; })); - m_menu->addAction("Column Visibility...", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Column Visibility...", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Column Visibility...", UIAction([&]() { showColumnVisibilityDialog(); })); - m_menu->addAction("Reset Columns to Default", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Reset Columns to Default", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Reset Columns to Default", UIAction([&]() { resetColumnsToDefault(); })); - m_menu->addAction("Add TTD Bookmark...", "Bookmark", MENU_ORDER_NORMAL); + m_menu.addAction("Add TTD Bookmark...", "Bookmark", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Add TTD Bookmark...", UIAction([&]() { int row = m_resultsTable->currentRow(); if (row < 0) @@ -551,7 +550,7 @@ void TTDCallsQueryWidget::contextMenuEvent(QContextMenuEvent* event) void TTDCallsQueryWidget::showContextMenu(const QPoint& position) { - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } bool TTDCallsQueryWidget::canCopy() diff --git a/ui/ttdcallswidget.h b/ui/ttdcallswidget.h index 3e51a037..e09b78be 100644 --- a/ui/ttdcallswidget.h +++ b/ui/ttdcallswidget.h @@ -97,7 +97,7 @@ class TTDCallsQueryWidget : public QWidget // UIAction support UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; - Menu* m_menu; + Menu m_menu; void setupUI(); void setupTable(); diff --git a/ui/ttdeventswidget.cpp b/ui/ttdeventswidget.cpp index 23fadea1..f62bd907 100644 --- a/ui/ttdeventswidget.cpp +++ b/ui/ttdeventswidget.cpp @@ -328,29 +328,28 @@ void TTDEventsQueryWidget::setupUIActions() { m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); - m_menu = new Menu(); // Add Copy action with Ctrl+C support - m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Row", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Row", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy Row", UIAction([&]() { copySelectedRow(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Table", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Table", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy Table", UIAction([&]() { copyEntireTable(); }, [&]() { return m_resultsTable->rowCount() > 0; })); - m_menu->addAction("Column Visibility...", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Column Visibility...", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Column Visibility...", UIAction([&]() { showColumnVisibilityDialog(); })); - m_menu->addAction("Reset Columns to Default", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Reset Columns to Default", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Reset Columns to Default", UIAction([&]() { resetColumnsToDefault(); })); // Refresh action to clear and re-query from backend - m_menu->addAction("Refresh", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Refresh", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Refresh", UIAction([&]() { refreshEvents(); })); - m_menu->addAction("Add TTD Bookmark...", "Bookmark", MENU_ORDER_NORMAL); + m_menu.addAction("Add TTD Bookmark...", "Bookmark", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Add TTD Bookmark...", UIAction([&]() { int row = m_resultsTable->currentRow(); if (row < 0) @@ -850,7 +849,7 @@ void TTDEventsQueryWidget::contextMenuEvent(QContextMenuEvent* event) { if (m_contextMenuManager) { - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } } @@ -858,7 +857,7 @@ void TTDEventsQueryWidget::showContextMenu(const QPoint& position) { if (m_contextMenuManager) { - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } } diff --git a/ui/ttdeventswidget.h b/ui/ttdeventswidget.h index 7f44352d..0f6bb280 100644 --- a/ui/ttdeventswidget.h +++ b/ui/ttdeventswidget.h @@ -119,7 +119,7 @@ class TTDEventsQueryWidget : public QWidget // UIAction support UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; - Menu* m_menu; + Menu m_menu; // All events cache std::vector m_allEvents; diff --git a/ui/ttdmemorywidget.cpp b/ui/ttdmemorywidget.cpp index 509d3816..ebf8f872 100644 --- a/ui/ttdmemorywidget.cpp +++ b/ui/ttdmemorywidget.cpp @@ -308,25 +308,24 @@ void TTDMemoryQueryWidget::setupUIActions() { m_actionHandler.setupActionHandler(this); m_contextMenuManager = new ContextMenuManager(this); - m_menu = new Menu(); // Add Copy action with Ctrl+C support - m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy", UIAction([&]() { copy(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Row", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Row", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy Row", UIAction([&]() { copySelectedRow(); }, [&]() { return canCopy(); })); - m_menu->addAction("Copy Table", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Copy Table", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Copy Table", UIAction([&]() { copyEntireTable(); }, [&]() { return m_resultsTable->rowCount() > 0; })); - m_menu->addAction("Column Visibility...", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Column Visibility...", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Column Visibility...", UIAction([&]() { showColumnVisibilityDialog(); })); - m_menu->addAction("Reset Columns to Default", "Options", MENU_ORDER_NORMAL); + m_menu.addAction("Reset Columns to Default", "Options", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Reset Columns to Default", UIAction([&]() { resetColumnsToDefault(); })); - m_menu->addAction("Add TTD Bookmark...", "Bookmark", MENU_ORDER_NORMAL); + m_menu.addAction("Add TTD Bookmark...", "Bookmark", MENU_ORDER_NORMAL); m_actionHandler.bindAction("Add TTD Bookmark...", UIAction([&]() { int row = m_resultsTable->currentRow(); if (row < 0) @@ -656,7 +655,7 @@ void TTDMemoryQueryWidget::contextMenuEvent(QContextMenuEvent* event) void TTDMemoryQueryWidget::showContextMenu(const QPoint& position) { - m_contextMenuManager->show(m_menu, &m_actionHandler); + m_contextMenuManager->show(&m_menu, &m_actionHandler); } bool TTDMemoryQueryWidget::canCopy() diff --git a/ui/ttdmemorywidget.h b/ui/ttdmemorywidget.h index 1e116777..b7347bf8 100644 --- a/ui/ttdmemorywidget.h +++ b/ui/ttdmemorywidget.h @@ -110,7 +110,7 @@ class TTDMemoryQueryWidget : public QWidget // UIAction support UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; - Menu* m_menu; + Menu m_menu; void setupUI(); void setupTable();