-void Trace::compute_text_size(QPainter &p)
-{
- _text_size = QSize(
- p.boundingRect(QRectF(), 0, _name).width(),
- p.boundingRect(QRectF(), 0, "Tg").height());
-}
-
-QRectF Trace::get_label_rect(int right)
-{
- using pv::view::View;
-
- assert(_view);
-
- const QSizeF label_size(
- _text_size.width() + View::LabelPadding.width() * 2,
- ceilf((_text_size.height() + View::LabelPadding.height() * 2) / 2) * 2);
- const float label_arrow_length = label_size.height() / 2;
- return QRectF(
- right - label_arrow_length - label_size.width() - 0.5,
- get_y() + 0.5f - label_size.height() / 2,
- label_size.width(), label_size.height());
-}
-
-void Trace::on_action_set_name_triggered()
-{
- bool ok = false;
-
- const QString new_label = QInputDialog::getText(_context_parent,
- tr("Set Name"), tr("Name"), QLineEdit::Normal, get_name(),
- &ok);
-
- if (ok)
- set_name(new_label);
-}
-
-void Trace::on_action_set_colour_triggered()