X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fflag.cpp;fp=pv%2Fviews%2Ftrace%2Fflag.cpp;h=c356b15bf62bba31341b0f22f8a24a2ed5813dd1;hp=b0518b646d87c493d8c13de606570f8dccf92522;hb=ef6cbaa21144ff25a74d5940bbe1c11ab2717e42;hpb=3d396c8e797847eb0bcc3fc6901837c32acb2e7d diff --git a/pv/views/trace/flag.cpp b/pv/views/trace/flag.cpp index b0518b64..c356b15b 100644 --- a/pv/views/trace/flag.cpp +++ b/pv/views/trace/flag.cpp @@ -57,7 +57,11 @@ bool Flag::enabled() const return true; } -QString Flag::get_text() const +/** + * Returns the text used to display this flag item. This is not necessarily the + * name that the user has given it. + */ +QString Flag::get_display_text() const { QString s; @@ -73,6 +77,14 @@ QString Flag::get_text() const return s; } +/** + * Returns the text of this flag item, i.e. the user-editable name. + */ +QString Flag::get_text() const +{ + return text_; +} + void Flag::set_text(const QString &text) { text_ = text; @@ -92,7 +104,7 @@ QRectF Flag::label_rect(const QRectF &rect) const const float x = get_x(); QFontMetrics m(QApplication::font()); - QSize text_size = m.boundingRect(get_text()).size(); + QSize text_size = m.boundingRect(get_display_text()).size(); const QSizeF label_size( text_size.width() + LabelPadding.width() * 2,