QCText Class
QCText is a cacheable text container for QCPainter. More...
| Header: | #include <QCText> |
Public Functions
| QCText() | |
| QCText(const QRectF &rect) | |
| QCText(float x, float y, float width, float height) | |
| QCText(const QCText &text) | |
| ~QCText() | |
| float | fontSize() const |
| quint32 | getId() const |
| float | height() const |
| void | setFontSize(float size) |
| void | setHeight(float height) |
| void | setRect(const QRectF &rect) |
| void | setText(const QString &text) |
| void | setWidth(float width) |
| void | setX(float x) |
| void | setY(float y) |
| QString | text() const |
| float | width() const |
| float | x() const |
| float | y() const |
| QCText & | operator=(const QCText &other) |
Detailed Description
Warning: This API is still under active development and likely to change in future versions.
QCText contains static text which can be cached by QCPainter. Since it has a persistent identity, it can be redrawn without having to layout the text, provided it has not been modified.
Note: This class is explicitly shared. This means that modifying a copy will also modify the original.
Member Function Documentation
QCText::QCText()
Constructs a default text container.
QCText::QCText(const QRectF &rect)
Constructs a text container with a position and size given by rect.
QCText::QCText(float x, float y, float width, float height)
Constructs a text container positioned at x and y, with dimensions width and height.
[noexcept] QCText::QCText(const QCText &text)
Constructs an text container that is a copy of the given text.
[noexcept] QCText::~QCText()
Destroys the text container.
float QCText::fontSize() const
Returns the font size for the text container.
See also setFontSize().
quint32 QCText::getId() const
Returns the persistent ID of the text container.
float QCText::height() const
Returns the vertical extent of the text container.
See also setHeight().
void QCText::setFontSize(float size)
Sets the font size for the text container to size.
See also fontSize().
void QCText::setHeight(float height)
Sets the vertical extent of the text container to height.
See also height().
void QCText::setRect(const QRectF &rect)
Sets the position and size of the text container to rect.
void QCText::setText(const QString &text)
Sets the text string of the text container to text.
See also text().
void QCText::setWidth(float width)
Sets the horizontal extent of the text container to width.
See also width().
void QCText::setX(float x)
Sets the horizontal position of the text container to x.
See also x().
void QCText::setY(float y)
Sets the vertical position of the text container to y.
See also y().
QString QCText::text() const
Returns the text string of the text container.
See also setText().
float QCText::width() const
Returns the horizontal extent of the text container.
See also setWidth().
float QCText::x() const
Returns the horizontal position of the text container.
See also setX().
float QCText::y() const
Returns the vertical position of the text container.
See also setY().
[noexcept] QCText &QCText::operator=(const QCText &other)
Assigns the text container other to this text container and returns a reference to this text container.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.