X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fflag.cpp;h=380ef3273091b1f4d8d29f1bc68a5dd296e581da;hp=81cfae873eb82365f355b109c15cc54b0d390e4a;hb=48257a69ffad409c9893605d99cd6e15161dff4f;hpb=97430d7726c69e1710aef223c39c760c79721ff5 diff --git a/pv/view/flag.cpp b/pv/view/flag.cpp index 81cfae87..380ef327 100644 --- a/pv/view/flag.cpp +++ b/pv/view/flag.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include @@ -37,7 +37,7 @@ namespace view { const QColor Flag::FillColour(0x73, 0xD2, 0x16); -Flag::Flag(View &view, double time, const QString &text) : +Flag::Flag(View &view, const pv::util::Timestamp& time, const QString &text) : TimeMarker(view, FillColour, time), text_(text) { @@ -61,7 +61,12 @@ QString Flag::get_text() const pv::widgets::Popup* Flag::create_popup(QWidget *parent) { - pv::widgets::Popup *const popup = TimeMarker::create_popup(parent); + using pv::widgets::Popup; + + Popup *const popup = TimeMarker::create_popup(parent); + popup->set_position(parent->mapToGlobal( + point(parent->rect())), Popup::Bottom); + QFormLayout *const form = (QFormLayout*)popup->layout(); QLineEdit *const text_edit = new QLineEdit(popup); @@ -103,5 +108,15 @@ void Flag::on_text_changed(const QString &text) view_.time_item_appearance_changed(true, false); } +void Flag::drag_by(const QPoint &delta) +{ + // Treat trigger markers as immovable + if (text_ == "T") + return; + + TimeMarker::drag_by(delta); +} + + } // namespace view } // namespace pv