void MarginWidget::show_popup(const shared_ptr<ViewItem> &item)
{
pv::widgets::Popup *const p = item->create_popup(this);
+
+ connect(p, SIGNAL(closed()), this, SLOT(on_popup_closed()));
+
if (p)
p->show();
}
ViewWidget::keyPressEvent(event);
}
+void MarginWidget::on_popup_closed()
+{
+ bool cursor_above_widget = rect().contains(mapFromGlobal(QCursor::pos()));
+
+ if (!cursor_above_widget)
+ mouse_point_ = QPoint(INT_MIN, INT_MIN);
+
+ update();
+}
+
+
} // namespace trace
} // namespace views
} // namespace pv
*/
void show_popup(const shared_ptr<ViewItem> &item);
-protected:
+protected Q_SLOTS:
virtual void contextMenuEvent(QContextMenuEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
+
+ virtual void on_popup_closed();
};
} // namespace trace