diff options
author | Chris Meyer <cmeyer1969@gmail.com> | 2013-08-26 16:15:23 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-09 22:58:45 +0200 |
commit | 391459210de53e342ba5e9c44360754e86d7625c (patch) | |
tree | f68fca8e2f059f8e07b2638245451137af79b479 /examples/quick/externaldraganddrop/doc | |
parent | 2dcb0adc3a0a9b93b4cd09f26f2d1bac0e8cd110 (diff) |
Add support for external drag and drop in Quick items.
Add dragType enums with values of None, Automatic, Internal (default).
Setting to Automatic allows startDrag to be called automatically.
Setting to Internal (default) retains old behavior.
Add mimeData to Drag item to enable external drags.
Call startDrag to start drag manually or change from internal drag to
external drag. Added events dragStarted and dragFinished that get
invoked from startDrag.
Mime data must be specified in the mimeData property as
mime-type / data pairs.
Moved QQuickDrag from qquickmousearea* files to qquickdrag* files to
reduce header interdependencies that caused linking errors in other
modules and also to improve code organization.
Allow DropArea to receive and process external data.
Introduced new variable containsDrag to QQuickDropAreaPrivate. This
replaces mimeData which was previously being used to determine if a
drop operation was currently occurring. The problem was that mimeData
was being externally destructed.
Also introduced accessor methods for getting color, html, image, text,
and urls out of the drop. This facilitates dropping of external data of
those types onto a DropArea.
Added example quick/externaldraganddrop.
Task-number: QTBUG-27498
Change-Id: I1420df7c161ea3399e49a23305273e106baa246f
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'examples/quick/externaldraganddrop/doc')
-rw-r--r-- | examples/quick/externaldraganddrop/doc/images/qml-dnd2-example.png | bin | 0 -> 48666 bytes | |||
-rw-r--r-- | examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc | 38 |
2 files changed, 38 insertions, 0 deletions
diff --git a/examples/quick/externaldraganddrop/doc/images/qml-dnd2-example.png b/examples/quick/externaldraganddrop/doc/images/qml-dnd2-example.png Binary files differnew file mode 100644 index 0000000000..e657d81795 --- /dev/null +++ b/examples/quick/externaldraganddrop/doc/images/qml-dnd2-example.png diff --git a/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc b/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc new file mode 100644 index 0000000000..1251e6e1eb --- /dev/null +++ b/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/*! + \title Qt Quick Examples - externaldraganddrop + \example externaldraganddrop + \brief This is an example of drag and drop between Qml and other applications + \image qml-dnd2-example.png + \ingroup qtquickexamples + + This example shows you how to respond to do drag and drop using MouseArea and DropArea. + + Drag text between boxes, out of boxes into other applications, and from other applications into the boxes. Use option/ctrl to copy rather than move text when dragging between boxes. + +*/ |