TimeItem: Made paint_label a mandatory field
[pulseview.git] / pv / view / cursorheader.cpp
index 22c1259f99622fb94d53d74ab41098f0ff265ac7..981a958b8d0d94ec3d515fcfba3dce82844c8d76 100644 (file)
@@ -78,7 +78,7 @@ void CursorHeader::paintEvent(QPaintEvent*)
 
        // Draw the cursors
        if (view_.cursors_shown())
-               view_.cursors()->draw_markers(p, r);
+               view_.cursors()->paint_label(p, r);
 }
 
 void CursorHeader::mouseMoveEvent(QMouseEvent *e)
@@ -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;