• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

DragAndDrop

Signals | Public Member Functions | Properties | List of all members
DeclarativeMimeData Class Reference

#include <DeclarativeMimeData.h>

Inheritance diagram for DeclarativeMimeData:
Inheritance graph
[legend]

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

DeclarativeMimeData::DeclarativeMimeData ( )
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
void DeclarativeMimeData::colorChanged ( )
signal
void DeclarativeMimeData::htmlChanged ( )
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
void DeclarativeMimeData::sourceChanged ( )
signal
void DeclarativeMimeData::textChanged ( )
signal
QUrl DeclarativeMimeData::url ( ) const
void DeclarativeMimeData::urlChanged ( )
signal
QVariantList DeclarativeMimeData::urls ( ) const
void DeclarativeMimeData::urlsChanged ( )
signal

Property Documentation

QColor DeclarativeMimeData::color
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.

QString DeclarativeMimeData::html
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.

QDeclarativeItem * DeclarativeMimeData::source
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.

QString DeclarativeMimeData::text
readwrite

A plain text (MIME type text/plain) representation of the data.

Definition at line 39 of file DeclarativeMimeData.h.

QUrl DeclarativeMimeData::url
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.

QVariantList DeclarativeMimeData::urls
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:
  • DeclarativeMimeData.h
  • DeclarativeMimeData.cpp
This file is part of the KDE documentation.
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.

DragAndDrop

Skip menu "DragAndDrop"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal