QConstString(3qt)

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

πŸ’– QConstString(3qt) πŸ’–

okay bestie, pull up a chair, we're talking about QConstString from the Qt 3 era β€” this is the qconststring man page and it's giving extremely niche but honestly? kinda iconic. ✨


🌸 NAME 🌸

QConstString β€” String objects using constant Unicode data. that's it, that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

okay so first thing, and this is important, no cap:

All the functions in this class are reentrant when Qt is built with thread support.

periodt. πŸ’…

and you get to it like this:

#include <qstring.h>

🫢 Public Members 🫢

here's the whole cast, main character energy only:

QConstString ( const QChar * unicode, uint length )
~QConstString ()
const QString & string () const

πŸ¦‹ DESCRIPTION πŸ¦‹

so. the QConstString class provides string objects using constant Unicode data. that's the whole job, she's a specialist. πŸ‘‘

here's the tea though: if you're building a highly optimized application and you want to minimize copying (because copying is lowkey expensive and we are NOT about that), you can use QConstString to hand yourself a QString-compatible object built from Unicode data you already have lying around. slay, right? but β€” and this is the catch, bestie, listen β€” it is then the programmer's responsibility to make sure that Unicode data exists for the entire lifetime of the QConstString object. the entire lifetime. if that data dips out early, everything falls apart, and it will be your fault, not hers. 😭

so how do you even make one? you create a QConstString with the QConstString constructor (yes that's the name, we're consistent here). and then the string it's holding? you grab it by calling string(). simple, clean, no drama. ✨

See also: Text Related Classes. (iykyk)


πŸ’… MEMBER FUNCTION DOCUMENTATION πŸ’…

πŸ“ QConstString::QConstString ( const QChar * unicode, uint length )

constructs a QConstString that uses the first length Unicode characters in the array unicode. okay and here's the cute part β€” any attempt to modify copies of the string will cause it to create a copy of the data, so it remains forever unmodified. she's immutable, she's committed, she's not changing for anybody. 🧚

the data in unicode is NOT copied. 🚨 the caller must be able to guarantee that unicode will not be deleted or modified. like, genuinely guarantee it. this is the whole deal.

πŸ’œ QConstString::~QConstString ()

destroys the QConstString, creating a copy of the data if other strings are still using it. she's leaving but she's not gonna strand anybody, very considerate of her honestly. 🫢

⭐ const QString & QConstString::string () const

returns a constant string referencing the data passed during construction. that's it. that's the function. go get your string, bestie. 🌈


πŸ”₯ SEE ALSO πŸ”₯


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

(yeah, 1992-2007, she's been around, she's a legacy icon, respect it πŸ’…)


πŸŽ€ AUTHOR πŸŽ€

Generated automatically from the source code. no human wrote this, it just manifested. iconic behavior 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. 🫢 (fr fr, they mean it, help them help you)

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. πŸ™ˆ (we're the scrappy little alternative format, and that's okay)

if you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qconststring.3qt) and the Qt version (3.3.8). please, they're begging, include both. 😭


and that's the whole page, bestie!! this lil cutie came to you courtesy of Trolltech AS, dated 2 February 2007, living in Qt version 3.3.8 β€” go forth and build your QString-compatible objects responsibly, keep that Unicode data alive for the whole lifetime, and don't let her down. mwah. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from