QTextDrag(3qt)

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

πŸ’… QTextDrag β€” like, the whole manual, bestie

okay so this is the manual page for QTextDrag, and yeah it lives in section 3qt of the Qt man pages. Buckle up, it's a short one but it's iconic. πŸŽ€


✨ NAME ✨

QTextDrag</purl> β€” the drag-and-drop object for transferring plain text and Unicode text. it's giving clipboard-but-glowier. πŸ¦‹


✨ SYNOPSIS ✨

#include <qdragobject.h>

Inherits QDragObject. yes she's a nepo baby, but a talented one. πŸ’…

🌸 Public Members 🌸

QTextDrag ( const QString & text, QWidget * dragSource = 0, const char *
    name = 0 )
QTextDrag ( QWidget * dragSource = 0, const char * name = 0 )
~QTextDrag ()
virtual void setText ( const QString & text )
virtual void setSubtype ( const QCString & st )

⭐ Static Public Members ⭐

bool canDecode ( const QMimeSource * e )
bool decode ( const QMimeSource * e, QString & str )
bool decode ( const QMimeSource * e, QString & str, QCString & subtype )

✨ DESCRIPTION ✨

The QTextDrag class is a drag and drop object for transferring plain and Unicode text. that's the whole job. she does it beautifully. πŸ’–

Plain text gets passed in a QString, and bestie, that QString can absolutely contain multiple lines β€” like, newline characters in there, no problem. the drag target receives those newlines the way the runtime environment wants them, e.g. LF on Unix, and CRLF on Windows. she's adaptable. she's flexible. she reads the room. 😌

🫢 heads up: Qt provides no built-in mechanism for delivering only a single-line. so if you wanted just one lil line, that's on you, babe.

want the full lore on drag and drop? go see the QDragObject class and the drag and drop documentation. πŸ“š

See also Drag And Drop Classes. πŸ’«


✨ MEMBER FUNCTION DOCUMENTATION ✨

πŸŽ€ QTextDrag::QTextDrag ( const QString & text, QWidget * dragSource = 0, const char * name = 0 )

Constructs a text drag object and sets its data to text. dragSource must be the drag source; name is the object name. slay, now she has ✨content✨.

πŸŽ€ QTextDrag::QTextDrag ( QWidget * dragSource = 0, const char * name = 0 )

Constructs a default text drag object. dragSource must be the drag source; name is the object name. the blank canvas version. 🎨

πŸŽ€ QTextDrag::~QTextDrag ()

Destroys the text drag object and frees up all allocated resources. she's cleaning up after herself, as she should. πŸ’…βœ¨

πŸŽ€ bool QTextDrag::canDecode ( const QMimeSource * e ) [static]

Returns TRUE if the information in e can be decoded into a QString; otherwise returns FALSE. like a vibe check but for mime data. πŸ”

See also decode().

Example: iconview/simple_dd/main.cpp.

πŸŽ€ bool QTextDrag::decode ( const QMimeSource * e, QString & str ) [static]

Attempts to decode the dropped information in e into str. Returns TRUE if successful; otherwise returns FALSE. 🫢

See also canDecode().

Example: iconview/simple_dd/main.cpp.

πŸŽ€ bool QTextDrag::decode ( const QMimeSource * e, QString & str, QCString & subtype ) [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function. yes queen, she's the deluxe edition. πŸ‘‘

Attempts to decode the dropped information in e into str. Returns TRUE if successful; otherwise returns FALSE. If subtype is null, any text subtype is accepted; otherwise only the specified subtype is accepted. picky but in a cute way. πŸŽ€

See also canDecode().

πŸŽ€ void QTextDrag::setSubtype ( const QCString & st ) [virtual]

Sets the MIME subtype of the text being dragged to st. The default subtype is "plain", so the default MIME type of the text is "text/plain". πŸ’Œ You might use this to declare that the text is "text/html" by calling setSubtype("html"). glow-up achieved. ✨

πŸŽ€ void QTextDrag::setText ( const QString & text ) [virtual]

Sets the text to be dragged to text. You will need to call this if you did not pass the text during construction. tl;dr β€” forgot to bring the text? drop it in here, 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. πŸ“œ


✨ AUTHOR ✨

Generated automatically from the source code. (no human author to @, she wrote herself fr fr πŸ€–βœ¨)


✨ 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. πŸ™ (yes, good bug reports are a love language, no cap.)

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 on our own out here, bestie)

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qtextdrag.3qt) and the Qt version (3.3.8). πŸ›πŸ«Ά


okay and that's the whole page, love u, bye! this lil time capsule was brought to you by Trolltech AS on 2 February 2007, and the Qt version floating around in here is 3.3.8. πŸ’–βœ¨πŸŽ€ stay slay, keep decoding. πŸ¦‹

πŸ“¦ where this page comes from