]> sigrok.org Git - pulseview.git/commitdiff
CursorHeader: Accept TimeItems not providing a Popup
authorJoel Holdsworth <redacted>
Mon, 8 Dec 2014 23:25:26 +0000 (23:25 +0000)
committerUwe Hermann <redacted>
Wed, 10 Dec 2014 17:06:16 +0000 (18:06 +0100)
pv/view/cursorheader.cpp

index 22c1259f99622fb94d53d74ab41098f0ff265ac7..7fc02add408c19438f6c3ea4bce980cd9dc5db64 100644 (file)
@@ -132,10 +132,12 @@ void CursorHeader::mouseReleaseEvent(QMouseEvent *)
 
        if (!dragging_ && mouse_down_item_) {
                Popup *const p = mouse_down_item_->create_popup(&view_);
 
        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;
        }
 
        dragging_ = false;