Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
5#ifndef QDRAG_H
6#define QDRAG_H
7
8#include <QtGui/qtguiglobal.h>
9#include <QtCore/qobject.h>
10
12
13QT_BEGIN_NAMESPACE
14
15class QMimeData;
16class QDragPrivate;
17class QPixmap;
18class QPoint;
19class QDragManager;
20
21
22class Q_GUI_EXPORT QDrag : public QObject
23{
24 Q_OBJECT
25 Q_DECLARE_PRIVATE(QDrag)
26public:
27 explicit QDrag(QObject *dragSource);
28 ~QDrag();
29
30 void setMimeData(QMimeData *data);
31 QMimeData *mimeData() const;
32
33 void setPixmap(const QPixmap &);
34 QPixmap pixmap() const;
35
36 void setHotSpot(const QPoint &hotspot);
37 QPoint hotSpot() const;
38
39 QObject *source() const;
40 QObject *target() const;
41
42 Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction);
43 Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultAction);
44
45 void setDragCursor(const QPixmap &cursor, Qt::DropAction action);
46 QPixmap dragCursor(Qt::DropAction action) const;
47
48 Qt::DropActions supportedActions() const;
49 Qt::DropAction defaultAction() const;
50
51 static void cancel();
52
53Q_SIGNALS:
54 void actionChanged(Qt::DropAction action);
55 void targetChanged(QObject *newTarget);
56
57private:
58 friend class QDragManager;
59 Q_DISABLE_COPY(QDrag)
60};
61
62QT_END_NAMESPACE
63
64#endif // QDRAG_H
\inmodule QtGui
Definition qdrag.h:23
\inmodule QtCore\reentrant
Definition qpoint.h:30
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(draganddrop)