44 #ifndef QT_NO_DRAGANDDROP 126 if (qt_qws_dnd_deco) {
130 pm = drag_object->
pixmap();
132 pm_hot = drag_object->
hotSpot();
142 qt_qws_dnd_deco->
show();
144 qt_qws_dnd_deco->
hide();
158 qt_qws_dnd_deco->
show();
170 qt_qws_dnd_deco->
hide();
178 if (beingCancelled) {
180 qApp->removeEventFilter(
this);
182 beingCancelled =
false;
206 qApp->removeEventFilter(
this);
207 beingCancelled =
false;
219 qWarning(
"QDragManager::eventFilter: No object");
236 if (qt_qws_dnd_deco && cw == qt_qws_dnd_deco)
237 cw =
object->target();
242 if (object->target() != cw) {
243 if (object->target()) {
249 restoreCursor =
true;
250 object->d_func()->target = 0;
253 object->d_func()->target = cw;
260 restoreCursor =
true;
270 willDrop = dme.isAccepted();
283 qApp->removeEventFilter(
this);
289 restoreCursor =
false;
291 if (
object && object->target()) {
306 object->deleteLater();
307 drag_object =
object = 0;
322 if (
object == o || !o || !o->
source())
327 qApp->removeEventFilter(
this);
328 beingCancelled =
false;
331 object = drag_object = o;
339 restoreCursor =
true;
340 object->d_func()->target = 0;
341 qApp->installEventFilter(
this);
346 restoreCursor =
true;
353 (void) eventLoop->
exec();
369 beingCancelled =
true;
371 if (object->target()) {
379 restoreCursor =
false;
385 object->deleteLater();
386 drag_object =
object = 0;
412 return formats().contains(format);
423 #endif // QT_NO_DRAGANDDROP The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
Qt::DropActions possible_actions
The QKeyEvent class describes a key event.
bool hasFormat_sys(const QString &mimeType) const
QStringList formats_sys() const
The QCursor class provides a mouse cursor with an arbitrary shape.
QWidget * source() const
Returns the source of the drag object.
#define QT_END_NAMESPACE
This macro expands to.
virtual QStringList formats() const
Returns a list of formats supported by the object.
The QDrag class provides support for MIME-based drag and drop data transfer.
int width() const
Returns the width of the pixmap.
The QByteArray class provides an array of bytes.
static const int default_pm_hoty
void setDropAction(Qt::DropAction action)
Sets the action to be performed on the data by the target.
static bool qt_qws_dnd_dragging
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
void cancel(bool deleteSource=true)
The QString class provides a Unicode character string.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
The QObject class is the base class of all Qt objects.
Qt::DropAction drag(QDrag *)
static void changeOverrideCursor(const QCursor &)
Changes the currently active application override cursor to cursor.
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
int key() const
Returns the code of the key that was pressed or released.
static QCursor * overrideCursor()
Strips out vertical alignment flags and transforms an alignment align of Qt::AlignLeft into Qt::Align...
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QEventLoop class provides a means of entering and leaving an event loop.
static QShapedPixmapWidget * qt_qws_dnd_deco
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
static Qt::DropActions possible_actions
Q_CORE_EXPORT void qWarning(const char *,...)
Type
This enum type defines the types of variable that a QVariant can contain.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
QPixmap pixmap() const
Returns the pixmap used to represent the data in a drag and drop operation.
The QMimeData class provides a container for data that records information about its MIME type...
static const int default_pm_hotx
The QMouseEvent class contains parameters that describe a mouse event.
static QDragManager * self()
QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
QBitmap mask() const
Extracts a bitmap mask from the pixmap's alpha channel.
The QTimerEvent class contains parameters that describe a timer event.
static const char *const default_pm[]
QMimeData * mimeData() const
Returns the MIME data that is encapsulated by the drag object.
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
static QDrag * drag_object
#define QT_USE_NAMESPACE
This macro expands to using QT_NAMESPACE if QT_NAMESPACE is defined and nothing otherwise.
The QPixmap class is an off-screen image representation that can be used as a paint device...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
int height() const
Returns the height of the pixmap.
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
void move(const QPoint &)
static void restoreOverrideCursor()
Undoes the last setOverrideCursor().
static QPixmap * defaultPm
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
The QPaintEvent class contains event parameters for paint events.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
QDragPrivate * dragPrivate() const
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
static Qt::DropAction global_accepted_action
QPoint hotSpot() const
Returns the position of the hot spot relative to the top-left corner of the cursor.
static Qt::KeyboardModifiers oldstate
void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
Qt::CursorShape shape() const
Returns the cursor shape identifier.