Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdrag.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QDRAG_H
5#define QDRAG_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qobject.h>
9
10QT_REQUIRE_CONFIG(draganddrop);
11
13
14class QMimeData;
15class QDragPrivate;
16class QPixmap;
17class QPoint;
18class QDragManager;
19
20
21class Q_GUI_EXPORT QDrag : public QObject
22{
24 Q_DECLARE_PRIVATE(QDrag)
25public:
26 explicit QDrag(QObject *dragSource);
27 ~QDrag();
28
29 void setMimeData(QMimeData *data);
30 QMimeData *mimeData() const;
31
32 void setPixmap(const QPixmap &);
33 QPixmap pixmap() const;
34
35 void setHotSpot(const QPoint &hotspot);
36 QPoint hotSpot() const;
37
38 QObject *source() const;
39 QObject *target() const;
40
41 Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction);
42 Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultAction);
43
44 void setDragCursor(const QPixmap &cursor, Qt::DropAction action);
45 QPixmap dragCursor(Qt::DropAction action) const;
46
47 Qt::DropActions supportedActions() const;
48 Qt::DropAction defaultAction() const;
49
50 static void cancel();
51
54 void targetChanged(QObject *newTarget);
55
56private:
57 friend class QDragManager;
58 Q_DISABLE_COPY(QDrag)
59};
60
62
63#endif // QDRAG_H
\inmodule QtGui
Definition qdrag.h:22
void actionChanged(Qt::DropAction action)
This signal is emitted when the action associated with the drag changes.
void targetChanged(QObject *newTarget)
This signal is emitted when the target of the drag and drop operation changes, with newTarget the new...
\inmodule QtCore
Definition qmimedata.h:16
\inmodule QtCore
Definition qobject.h:103
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:25
QCursor cursor
Combined button and popup list for selecting options.
DropAction
@ MoveAction
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum target
GLsizei GLsizei GLchar * source
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define Q_SIGNALS
future cancel()
QMimeData * mimeData
dialog exec()
widget render & pixmap
imageLabel setPixmap(QPixmap::fromImage(image))