QCanvasText(3qt)
π QCanvasText π
okay bestie, welcome to the QCanvasText(3qt) era β this is the Qt 3 page, and it's giving "text object on a QCanvas" and nothing less. grab a boba, we're doing this. π§β¨
πΈ NAME πΈ
QCanvasText β a Text object on a QCanvas. that's it, that's the whole vibe check. π
β¨ SYNOPSIS β¨
#include <qcanvas.h>
Inherits QCanvasItem. yes queen, it's a whole inheritance situation. π
π Public Members π
QCanvasText ( QCanvas * canvas )
QCanvasText ( const QString & t, QCanvas * canvas )
QCanvasText ( const QString & t, QFont f, QCanvas * canvas )
virtual ~QCanvasText ()
void setText ( const QString & t )
void setFont ( const QFont & f )
void setColor ( const QColor & c )
QString text () const
QFont font () const
QColor color () const
int textFlags () const
void setTextFlags ( int f )
virtual QRect boundingRect () const
virtual int rtti () const
π Protected Members π
virtual void draw ( QPainter & painter )
π¦ DESCRIPTION π¦
so. the QCanvasText class provides a text object on a QCanvas. that's the whole assignment and it ate. π₯
a canvas text item has text with font, color and alignment attributes. the text and font can be set in the constructor, or set or changed later with setText() and setFont(). the color gets set with setColor() and the alignment with setTextFlags(). and when you need the text item's bounding rectangle? that's boundingRect(), babes. π
the text can be drawn on a painter with draw(). π¨
like any other canvas item, text items can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). move that text around like it's main character energy, because it literally is. β¨
See also Graphics Classes and Image Processing Classes. iykyk. π«
π MEMBER FUNCTION DOCUMENTATION π
QCanvasText::QCanvasText ( QCanvas * canvas )
constructs a QCanvasText with the text "<text>", on canvas. default text, no notes. π
QCanvasText::QCanvasText ( const QString & t, QCanvas * canvas )
constructs a QCanvasText with the text t, on canvas canvas. you brought your own text, slay. π
QCanvasText::QCanvasText ( const QString & t, QFont f, QCanvas * canvas )
constructs a QCanvasText with the text t and font f, on the canvas canvas. text AND font in one go? highkey efficient. π
QCanvasText::~QCanvasText () [virtual]
destroys the canvas text item. it's over bestie, but respectfully. π
QRect QCanvasText::boundingRect () const [virtual]
returns the bounding rectangle of the text. π«Ά
Reimplemented from QCanvasItem.
QColor QCanvasText::color () const
returns the color of the text. π
See also setColor().
void QCanvasText::draw ( QPainter & painter ) [virtual protected]
draws the text using the painter painter. go off, painter. ποΈ
Reimplemented from QCanvasItem.
QFont QCanvasText::font () const
returns the font in which the text is drawn. π
See also setFont().
int QCanvasText::rtti () const [virtual]
returns 3 (QCanvasItem::Rtti_Text). that's the number, no cap. 3οΈβ£
See also QCanvasItem::rtti().
Reimplemented from QCanvasItem.
void QCanvasText::setColor ( const QColor & c )
sets the color of the text to the color c. paint it, bestie. π
See alsocolor()andsetFont().
Example: chart/chartform_canvas.cpp.
void QCanvasText::setFont ( const QFont & f )
sets the font in which the text is drawn to font f. glow-up for your glyphs. β¨
See also font().
void QCanvasText::setText ( const QString & t )
sets the text item's text to t. the text may contain newlines. yes, actual newlines, multi-line moment. π
See alsotext(),setFont(),setColor(), andsetTextFlags().
Example: canvas/canvas.cpp.
void QCanvasText::setTextFlags ( int f )
sets the alignment flags to f. these are a bitwise OR of the flags available to QPainter::drawText() β see the Qt::AlignmentFlags. bitwise OR, we love to see it. π§
See alsosetFont()andsetColor().
QString QCanvasText::text () const
returns the text item's text. the words. the content. π
See also setText().
int QCanvasText::textFlags () const
returns the currently set alignment flags. π
See alsosetTextFlags()andQt::AlignmentFlags.
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. read the license file, bestie, fr fr. π«‘
βοΈ AUTHOR βοΈ
Generated automatically from the source code. not me getting written by a script π iconic behaviour honestly.
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. thank you. (they said thank you!! so polite π₯Ή)
the definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. so like... it works, but it's not the canon version, you feel me? β οΈ
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qcanvastext.3qt) and the Qt version (3.3.8). include both!! don't make them guess!! π§
and that's the whole page, bestie. π this one came from Trolltech AS, 2 February 2007, and it's living in the Qt 3.3.8 universe. go forth and draw some text on a canvas. periodt. π
β¨π¦
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms