From 34f333f55fd3577c06c8383e568cb32829a00ec1 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Wed, 4 Mar 2015 15:17:50 +0100 Subject: [PATCH] Make "Add Function" generally available Allows to create new Functions even if point is over an existing function --- src/gui/Mainwindow.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index fe48f8f..a15aa66 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -133,10 +133,11 @@ void Mainwindow::showListContextMenu(const QPoint& point) { if (item) { QAction * act = menu.addAction("Rename Function"); connect(act, &QAction::triggered, [=]() {this->renameFunction(objects_list[item]->getFunction());}); - } else { - QAction * act = menu.addAction("AddFunction"); - connect(act, SIGNAL(triggered()), this, SLOT(requestNewFunction())); } + + QAction * act = menu.addAction("AddFunction"); + connect(act, SIGNAL(triggered()), this, SLOT(requestNewFunction())); + menu.exec(listWidget->mapToGlobal(point)); } -- 2.39.2