QDragMoveEvent(3qt)
π QDragMoveEvent β the manual page, but make it make sense π
okay bestie, so this is QDragMoveEvent, and it lives in section 3qt of the manual (that's the Qt library section, iykyk). It's a whole class, it's giving "drag and drop main character energy", and by the end of this you're gonna know it like the back of your hand. π¦
β¨ NAME β¨
QDragMoveEvent β the event that gets sent while a drag and drop is in progress. Like, mid-drag. The vibe check of the drag. π
β¨ SYNOPSIS β¨
#include <qevent.h>
So the tea is: it inherits QDropEvent, and it gets inherited by QDragEnterEvent. It's a middle child, but an iconic one. π
πΈ Public Members πΈ
QDragMoveEvent ( const QPoint & pos, Type type = DragMove )QRect answerRect () constvoid accept ( const QRect & r )void ignore ( const QRect & r )
β¨ DESCRIPTION β¨
QDragMoveEvent is the class that provides an event sent while a drag and drop is in progress. Not before, not after β during. The moment. β
So here's how it goes: when a widget accepts drop events, it will receive this event repeatedly while the drag is within the widget's boundaries. Repeatedly!! Like your bestie texting you the same screenshot four times. π
The widget should examine the event to see what data it provides, and accept() the drop if appropriate. That's the whole assignment, bestie. Look at the data, decide if it slays, accept it if it does.
Heads up: this class inherits most of its functionality from QDropEvent. It's not doing all the work itself, it's getting it from its parent. Nepo baby behavior, honestly, but we love it. π
See also Drag And Drop Classes and Event Classes.
β¨ MEMBER FUNCTION DOCUMENTATION β¨
π QDragMoveEvent::QDragMoveEvent ( const QPoint & pos, Type type = DragMove )
Creates a QDragMoveEvent for which the mouse is at point pos, and the event is of type type. That's it, that's the constructor. β¨
Warning: Do not create a QDragMoveEvent yourself since these objects rely on Qt's internal state. fr fr, do not. π Like, it is not going to work and you're gonna be sad about it. Let Qt handle its own internal state, babe.
π void QDragMoveEvent::accept ( const QRect & r )
The same as accept(), but also notifies that future moves will also be acceptable if they remain within the rectangle r on the widget: this can improve performance, but may also be ignored by the underlying system. So it's a suggestion, a little "hey, this zone is fine" note, and the system might just be like "ok whatever" and ignore it. Rude, but true. π
If the rectangle is empty, then drag move events will be sent continuously. This is useful if the source is scrolling in a timer event. No cap β empty rect means constant updates, which is exactly what you want when something's scrolling on a timer. π
Examples:
(that's literally it β the original just says "Examples:" and then nothing, so. iconic of it, honestly.) π«Ά
π QRect QDragMoveEvent::answerRect () const
Returns the rectangle for which the acceptance of the move event applies. So like, the "yes zone". The little box where your acceptance is valid. That's the answer rect. β
π void QDragMoveEvent::ignore ( const QRect & r )
The opposite of accept(const QRect&), i.e. it says that moves within rectangle r are not acceptable (will be ignored). The no-fly zone. The "not today" box. π
Example: dirview/dirview.cpp.
β¨ SEE ALSO β¨
go read them bestie, they're right there π₯
β¨ COPYRIGHT β¨
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. Not a person. A robot did this. Be nice to the robot. π€π
β¨ 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're literally being so polite about it. We love a gracious ask. π«Ά)
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's a gift, not a contract. π
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdragmoveevent.3qt) and the Qt version (3.3.8). Don't make them guess, bestie, that's mean. π
And that's the whole page!! πΈ This iconic little number was brought to you by Trolltech AS, dated 2 February 2007, filed under QDragMoveEvent(3qt) β so when you're citing it in the group chat you know exactly where it came from. bye bestie, go accept some drops π β¨ππ¦
π¦ 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