+QMenu* Trace::create_view_context_menu(QWidget *parent, QPoint &click_pos)
+{
+ context_menu_x_pos_ = click_pos.x();
+
+ // Get entries from default menu before adding our own
+ QMenu *const menu = new QMenu(parent);
+
+ QMenu* default_menu = TraceTreeItem::create_view_context_menu(parent, click_pos);
+ if (default_menu) {
+ for (QAction *action : default_menu->actions()) {
+ menu->addAction(action);
+ if (action->parent() == default_menu)
+ action->setParent(menu);
+ }
+ delete default_menu;
+
+ // Add separator if needed
+ if (menu->actions().length() > 0)
+ menu->addSeparator();
+ }
+
+ QAction *const create_marker_here = new QAction(tr("Create marker here"), this);
+ connect(create_marker_here, SIGNAL(triggered()), this, SLOT(on_create_marker_here()));
+ menu->addAction(create_marker_here);
+
+ return menu;
+}
+