From: Joel Holdsworth Date: Mon, 8 Dec 2014 23:25:26 +0000 (+0000) Subject: CursorHeader: Accept TimeItems not providing a Popup X-Git-Tag: pulseview-0.3.0~375 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=faeb1a29e7ee80c9535b443ae4f4985181834b7b CursorHeader: Accept TimeItems not providing a Popup --- diff --git a/pv/view/cursorheader.cpp b/pv/view/cursorheader.cpp index 22c1259f..7fc02add 100644 --- a/pv/view/cursorheader.cpp +++ b/pv/view/cursorheader.cpp @@ -132,10 +132,12 @@ void CursorHeader::mouseReleaseEvent(QMouseEvent *) if (!dragging_ && mouse_down_item_) { Popup *const p = mouse_down_item_->create_popup(&view_); - const QPoint arrpos(mouse_down_item_->get_x(), - height() - BaselineOffset); - p->set_position(mapToGlobal(arrpos), Popup::Bottom); - p->show(); + if (p) { + const QPoint arrpos(mouse_down_item_->get_x(), + height() - BaselineOffset); + p->set_position(mapToGlobal(arrpos), Popup::Bottom); + p->show(); + } } dragging_ = false;