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;
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;
+ view_.time_item_appearance_changed(true, false);
+}
+
QRectF Flag::label_rect(const QRectF &rect) const
{
QRectF r;
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,
void Flag::on_text_changed(const QString &text)
{
- text_ = text;
- view_.time_item_appearance_changed(true, false);
+ set_text(text);
}
} // namespace trace