From: Joel Holdsworth Date: Sat, 1 Nov 2014 10:05:32 +0000 (+0000) Subject: Header: Handle RowItems that do not create a context menu X-Git-Tag: pulseview-0.3.0~474 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a28878f4429e7cbd5ae28edc205032e740861396;p=pulseview.git Header: Handle RowItems that do not create a context menu --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 8377cb2c..fdfd896f 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -268,9 +268,14 @@ void Header::leaveEvent(QEvent*) void Header::contextMenuEvent(QContextMenuEvent *event) { const shared_ptr r = get_mouse_over_row_item(_mouse_point); + if (!r) + return; + + QMenu *const menu = r->create_context_menu(this); + if (!menu) + return; - if (r) - r->create_context_menu(this)->exec(event->globalPos()); + menu->exec(event->globalPos()); } void Header::keyPressEvent(QKeyEvent *e)