diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-05-22 15:42:25 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-14 12:46:58 (GMT) |
commit | c74c00b3a006491c4e7140fd7c5c2553d8abf45d (patch) | |
tree | 9803abf9f70d207dba1125bd51d0c453f83f7d7c /src/gui/text/qstatictext.h | |
parent | 1271197f70862fd1565039aff3b0e40665d3adde (diff) | |
download | Qt-c74c00b3a006491c4e7140fd7c5c2553d8abf45d.zip Qt-c74c00b3a006491c4e7140fd7c5c2553d8abf45d.tar.gz Qt-c74c00b3a006491c4e7140fd7c5c2553d8abf45d.tar.bz2 |
Add lazy initialization to QStaticText
People should be able to initialize the QStaticText lazily, or change
its data after instantiation. Each of the setters will recalculate the
layout to make sure it's always in sync.
Diffstat (limited to 'src/gui/text/qstatictext.h')
-rw-r--r-- | src/gui/text/qstatictext.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h index fc10712..a666a7e 100644 --- a/src/gui/text/qstatictext.h +++ b/src/gui/text/qstatictext.h @@ -56,9 +56,23 @@ class Q_GUI_EXPORT QStaticText { Q_DECLARE_PRIVATE(QStaticText); public: - QStaticText(const QString &text, const QFont &font, const QSizeF &maximumSize = QSizeF()); + QStaticText(); + QStaticText(const QString &text); + QStaticText(const QString &text, const QFont &font = QFont(), const QSizeF &maximumSize = QSizeF()); ~QStaticText(); + void isValid() const; + + void setText(const QString &text); + QString text() const; + + void setFont(const QFont &font); + QFont font() const; + + void setMaximumSize(const QSizeF &maximumSize); + QSizeF maximumSize() const; + + private: QStaticTextPrivate *d_ptr; }; |