aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickdrag_p.h
diff options
context:
space:
mode:
authorAlberto Mardegan <mardy@users.sourceforge.net>2016-04-11 23:10:29 +0300
committerAlberto Mardegan <mardy@users.sourceforge.net>2016-05-07 19:08:56 +0000
commit4b982c744f538a24e21a2af146c45f93d27dd1cb (patch)
treec2c117720d27be3f1a3cc9cf546832364f2af116 /src/quick/items/qquickdrag_p.h
parent69b7ba225007d68e113ee425ad58ce7e186a92c2 (diff)
Add imageSource property to attached Drag property
This property holds a URL which is loaded into a QPixmap via QQuickPixmap, and subsequently set on the QDrag object. This is especially important for drag and drop to external applications, where of course a QQuickItem cannot be dragged; however, combined with QQuickItem::grabToImage(), this change allows setting a QQuickItem's contents as the drag pixmap. [ChangeLog][QtQuick][Drag] Added imageSource property to attached Drag object: this allows drag sources to specify the pixmap to be drawn next to the mouse cursor when starting a drag and drop operation. Task-number: QTBUG-37366 Change-Id: Ibcf1d888c525e50976a116ec743ce6fca4c31525 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/quick/items/qquickdrag_p.h')
-rw-r--r--src/quick/items/qquickdrag_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h
index c1695e49f0..17721251d9 100644
--- a/src/quick/items/qquickdrag_p.h
+++ b/src/quick/items/qquickdrag_p.h
@@ -58,6 +58,7 @@
#include <QtCore/qmimedata.h>
#include <QtCore/qstringlist.h>
+#include <QtCore/qurl.h>
#ifndef QT_NO_DRAGANDDROP
@@ -247,6 +248,7 @@ class QQuickDragAttached : public QObject
Q_PROPERTY(QObject *source READ source WRITE setSource NOTIFY sourceChanged RESET resetSource)
Q_PROPERTY(QObject *target READ target NOTIFY targetChanged)
Q_PROPERTY(QPointF hotSpot READ hotSpot WRITE setHotSpot NOTIFY hotSpotChanged)
+ Q_PROPERTY(QUrl imageSource READ imageSource WRITE setImageSource NOTIFY imageSourceChanged REVISION 8)
Q_PROPERTY(QStringList keys READ keys WRITE setKeys NOTIFY keysChanged)
Q_PROPERTY(QVariantMap mimeData READ mimeData WRITE setMimeData NOTIFY mimeDataChanged)
Q_PROPERTY(Qt::DropActions supportedActions READ supportedActions WRITE setSupportedActions NOTIFY supportedActionsChanged)
@@ -268,6 +270,9 @@ public:
QPointF hotSpot() const;
void setHotSpot(const QPointF &hotSpot);
+ QUrl imageSource() const;
+ void setImageSource(const QUrl &url);
+
QStringList keys() const;
void setKeys(const QStringList &keys);
@@ -300,6 +305,7 @@ Q_SIGNALS:
void sourceChanged();
void targetChanged();
void hotSpotChanged();
+ void imageSourceChanged();
void keysChanged();
void mimeDataChanged();
void supportedActionsChanged();