QCanvasText(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– 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 also color() and setFont().
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 also text(), setFont(), setColor(), and setTextFlags().
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 also setFont() and setColor().

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 also setTextFlags() and Qt::AlignmentFlags.

πŸ”— SEE ALSO πŸ”—


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