DragAndDrop
#include <DeclarativeMimeData.h>
Signals | |
void | colorChanged () |
void | htmlChanged () |
void | sourceChanged () |
void | textChanged () |
void | urlChanged () |
void | urlsChanged () |
Public Member Functions | |
DeclarativeMimeData () | |
DeclarativeMimeData (const QMimeData *copy) | |
QColor | color () const |
void | setColor (const QColor &color) |
Q_INVOKABLE void | setData (const QString &mimeType, const QVariant &data) |
void | setSource (QDeclarativeItem *source) |
void | setUrl (const QUrl &url) |
void | setUrls (const QVariantList &urls) |
QDeclarativeItem * | source () const |
QUrl | url () const |
QVariantList | urls () const |
Properties | |
QColor | color |
QString | html |
QDeclarativeItem | source |
QString | text |
QUrl | url |
QVariantList | urls |
Detailed Description
MimeData DeclarativeMimeData
This is a wrapper class around QMimeData, with a few extensions to provide better support for in-qml drag & drops.
Creates a new DeclarativeMimeData by cloning the QMimeData passed as parameter. This is useful for two reasons :
- In DragArea, we want to clone our "working copy" of the DeclarativeMimeData instance, as Qt will automatically delete it after the drag and drop operation.
- In the drop events, the QMimeData is const, and we have troubles passing const to QML. So we clone it to remove the "constness"
This method will try to cast the QMimeData to DeclarativeMimeData, and will clone our extensions to QMimeData as well
Definition at line 32 of file DeclarativeMimeData.h.
Constructor & Destructor Documentation
|
inline |
Definition at line 69 of file DeclarativeMimeData.h.
DeclarativeMimeData::DeclarativeMimeData | ( | const QMimeData * | copy | ) |
Definition at line 45 of file DeclarativeMimeData.cpp.
Member Function Documentation
QColor DeclarativeMimeData::color | ( | ) | const |
|
signal |
|
signal |
void DeclarativeMimeData::setColor | ( | const QColor & | color | ) |
Definition at line 113 of file DeclarativeMimeData.cpp.
void DeclarativeMimeData::setData | ( | const QString & | mimeType, |
const QVariant & | data | ||
) |
Definition at line 121 of file DeclarativeMimeData.cpp.
void DeclarativeMimeData::setSource | ( | QDeclarativeItem * | source | ) |
Definition at line 143 of file DeclarativeMimeData.cpp.
void DeclarativeMimeData::setUrl | ( | const QUrl & | url | ) |
Definition at line 75 of file DeclarativeMimeData.cpp.
void DeclarativeMimeData::setUrls | ( | const QVariantList & | urls | ) |
Definition at line 95 of file DeclarativeMimeData.cpp.
QDeclarativeItem* DeclarativeMimeData::source | ( | ) | const |
|
signal |
|
signal |
QUrl DeclarativeMimeData::url | ( | ) | const |
|
signal |
QVariantList DeclarativeMimeData::urls | ( | ) | const |
|
signal |
Property Documentation
|
readwrite |
A color if the data stored in the object represents a color (MIME type application/x-color); otherwise QColor().
Definition at line 60 of file DeclarativeMimeData.h.
|
readwrite |
A string if the data stored in the object is HTML (MIME type text/html); otherwise returns an empty string.
Definition at line 44 of file DeclarativeMimeData.h.
|
readwrite |
The graphical item on the scene that started the drag event.
It may be null.
item MimeData::source
Setting source to any existing qml item will enable the receiver of the drag and drop operation to know in which item the operation originated.
In the case of inter-application drag and drop operations, the source will not be available, and will be 0. Be sure to test it in your QML code, before using it, or it will generate errors in the console.
Definition at line 65 of file DeclarativeMimeData.h.
|
readwrite |
A plain text (MIME type text/plain) representation of the data.
Definition at line 39 of file DeclarativeMimeData.h.
|
readwrite |
Url contained in the mimedata.
url MimeData::url
Returns the first URL from the urls property of QMimeData TODO: We should use QDeclarativeListProperty<QUrls> to return the whole list instead of only the first element.
Definition at line 49 of file DeclarativeMimeData.h.
|
readwrite |
A list of URLs contained within the MIME data object.
URLs correspond to the MIME type text/uri-list.
Definition at line 55 of file DeclarativeMimeData.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:02:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.