X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fflag.cpp;h=779ea2eec24cd8d5088b2675f9ede6978c682ba1;hp=81cfae873eb82365f355b109c15cc54b0d390e4a;hb=60d9b99a32e551cffd2b537d3e157d578a761c9b;hpb=97430d7726c69e1710aef223c39c760c79721ff5 diff --git a/pv/view/flag.cpp b/pv/view/flag.cpp index 81cfae87..779ea2ee 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);