File indexing completed on 2025-01-18 10:07:58
0001
0002
0003
0004 #ifndef QDRAG_H
0005 #define QDRAG_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qobject.h>
0009
0010 QT_REQUIRE_CONFIG(draganddrop);
0011
0012 QT_BEGIN_NAMESPACE
0013
0014 class QMimeData;
0015 class QDragPrivate;
0016 class QPixmap;
0017 class QPoint;
0018 class QDragManager;
0019
0020
0021 class Q_GUI_EXPORT QDrag : public QObject
0022 {
0023 Q_OBJECT
0024 Q_DECLARE_PRIVATE(QDrag)
0025 public:
0026 explicit QDrag(QObject *dragSource);
0027 ~QDrag();
0028
0029 void setMimeData(QMimeData *data);
0030 QMimeData *mimeData() const;
0031
0032 void setPixmap(const QPixmap &);
0033 QPixmap pixmap() const;
0034
0035 void setHotSpot(const QPoint &hotspot);
0036 QPoint hotSpot() const;
0037
0038 QObject *source() const;
0039 QObject *target() const;
0040
0041 Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction);
0042 Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultAction);
0043
0044 void setDragCursor(const QPixmap &cursor, Qt::DropAction action);
0045 QPixmap dragCursor(Qt::DropAction action) const;
0046
0047 Qt::DropActions supportedActions() const;
0048 Qt::DropAction defaultAction() const;
0049
0050 static void cancel();
0051
0052 Q_SIGNALS:
0053 void actionChanged(Qt::DropAction action);
0054 void targetChanged(QObject *newTarget);
0055
0056 private:
0057 friend class QDragManager;
0058 Q_DISABLE_COPY(QDrag)
0059 };
0060
0061 QT_END_NAMESPACE
0062
0063 #endif