+pv::widgets::Popup* Trace::create_popup(QWidget *parent)
+{
+ using pv::widgets::Popup;
+
+ popup_ = new Popup(parent);
+ popup_->set_position(parent->mapToGlobal(
+ point(parent->rect())), Popup::Right);
+
+ create_popup_form();
+
+ connect(popup_, SIGNAL(closed()),
+ this, SLOT(on_popup_closed()));
+
+ return popup_;
+}
+
+QRectF Trace::label_rect(const QRectF &rect) const
+{
+ using pv::view::View;
+
+ QFontMetrics m(QApplication::font());
+ const QSize text_size(
+ m.boundingRect(QRect(), 0, name_).width(), m.height());
+ const QSizeF label_size(
+ text_size.width() + LabelPadding.width() * 2,
+ ceilf((text_size.height() + LabelPadding.height() * 2) / 2) * 2);
+ const float half_height = label_size.height() / 2;