diff options
Diffstat (limited to 'examples/quick/externaldraganddrop')
9 files changed, 0 insertions, 210 deletions
diff --git a/examples/quick/externaldraganddrop/CMakeLists.txt b/examples/quick/externaldraganddrop/CMakeLists.txt deleted file mode 100644 index 3c31d55fa4..0000000000 --- a/examples/quick/externaldraganddrop/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) -project(externaldraganddrop LANGUAGES CXX) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/externaldraganddrop") - -find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) - -qt_standard_project_setup() - -qt_add_executable(externaldraganddropexample - WIN32 - MACOSX_BUNDLE - main.cpp -) - -qt_add_qml_module(externaldraganddropexample - URI externaldraganddrop - AUTO_RESOURCE_PREFIX - QML_FILES - "DragAndDropTextItem.qml" - "externaldraganddrop.qml" -) - -target_link_libraries(externaldraganddropexample PRIVATE - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick -) - -install(TARGETS externaldraganddropexample - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/quick/externaldraganddrop/DragAndDropTextItem.qml b/examples/quick/externaldraganddrop/DragAndDropTextItem.qml deleted file mode 100644 index c241f6ed82..0000000000 --- a/examples/quick/externaldraganddrop/DragAndDropTextItem.qml +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls - -Rectangle { - id: item - property string display - property alias dropEnabled: acceptDropCB.checked - color: dropArea.containsDrag ? "#CFC" : "#EEE" - ColorAnimation on color { - id: rejectAnimation - from: "#FCC" - to: "#EEE" - duration: 1000 - } - Label { - anchors.fill: parent - anchors.margins: 10 - text: item.display - wrapMode: Text.WordWrap - } - DropArea { - id: dropArea - anchors.fill: parent - keys: ["text/plain"] - onEntered: (drag) => { - if (!acceptDropCB.checked) { - drag.accepted = false - rejectAnimation.start() - } - } - onDropped: (drop) => { - if (drop.hasText && acceptDropCB.checked) { - if (drop.proposedAction == Qt.MoveAction || drop.proposedAction == Qt.CopyAction) { - item.display = drop.text - drop.acceptProposedAction() - } - } - } - } - MouseArea { - id: mouseArea - anchors.fill: parent - drag.target: draggable - } - Item { - id: draggable - anchors.fill: parent - Drag.active: mouseArea.drag.active - Drag.hotSpot.x: 0 - Drag.hotSpot.y: 0 - Drag.mimeData: { "text/plain": item.display } - Drag.dragType: Drag.Automatic - Drag.onDragFinished: (dropAction) => { - if (dropAction == Qt.MoveAction) - item.display = "" - } - } - CheckBox { - id: acceptDropCB - anchors.bottom: parent.bottom - checked: true - text: "accept drop" - } -} diff --git a/examples/quick/externaldraganddrop/doc/images/qml-dnd2-example.png b/examples/quick/externaldraganddrop/doc/images/qml-dnd2-example.png Binary files differdeleted file mode 100644 index e657d81795..0000000000 --- a/examples/quick/externaldraganddrop/doc/images/qml-dnd2-example.png +++ /dev/null diff --git a/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc b/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc deleted file mode 100644 index 974c91a3cc..0000000000 --- a/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only -/*! - \title Qt Quick Examples - externaldraganddrop - \example externaldraganddrop - \brief This is an example of drag-and-drop among QML applications. - \image qml-dnd2-example.png - \ingroup qtquickexamples - - \e externaldraganddrop demonstrates how to perform drag and - drop with \l MouseArea and \l DropArea. - - The example allows you to drag the text to other boxes, out of boxes into - other applications, and from other applications into the boxes. Use the - option or CTRL keys to copy rather than move text when dragging between - boxes. - - \include examples-run.qdocinc - -*/ diff --git a/examples/quick/externaldraganddrop/externaldraganddrop.pro b/examples/quick/externaldraganddrop/externaldraganddrop.pro deleted file mode 100644 index cd456f9b27..0000000000 --- a/examples/quick/externaldraganddrop/externaldraganddrop.pro +++ /dev/null @@ -1,12 +0,0 @@ -TEMPLATE = app - -QT += quick qml -SOURCES += main.cpp -RESOURCES += externaldraganddrop.qrc - -EXAMPLE_FILES = \ - externaldraganddrop.qml \ - DragAndDropTextItem.qml - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/externaldraganddrop -INSTALLS += target diff --git a/examples/quick/externaldraganddrop/externaldraganddrop.qml b/examples/quick/externaldraganddrop/externaldraganddrop.qml deleted file mode 100644 index b0cd20e69e..0000000000 --- a/examples/quick/externaldraganddrop/externaldraganddrop.qml +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - -Item { - id: root - width: 320 - height: 480 - - ColumnLayout { - - anchors.fill: parent - anchors.margins: 8 - - Label { - Layout.fillWidth: true - text: "Drag text into, out of, and between the boxes below." - wrapMode: Text.WordWrap - } - - DragAndDropTextItem { - Layout.fillWidth: true - Layout.fillHeight: true - display: "Sample Text" - } - - DragAndDropTextItem { - Layout.fillWidth: true - Layout.fillHeight: true - display: "Option/ctrl drag to copy instead of move text." - } - - DragAndDropTextItem { - Layout.fillWidth: true - Layout.fillHeight: true - dropEnabled: false - display: "Drag out into other applications." - } - } -} diff --git a/examples/quick/externaldraganddrop/externaldraganddrop.qmlproject b/examples/quick/externaldraganddrop/externaldraganddrop.qmlproject deleted file mode 100644 index 359efae597..0000000000 --- a/examples/quick/externaldraganddrop/externaldraganddrop.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "externaldraganddrop.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/externaldraganddrop/externaldraganddrop.qrc b/examples/quick/externaldraganddrop/externaldraganddrop.qrc deleted file mode 100644 index 94f7e47e24..0000000000 --- a/examples/quick/externaldraganddrop/externaldraganddrop.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/qt/qml/externaldraganddrop"> - <file>externaldraganddrop.qml</file> - <file>DragAndDropTextItem.qml</file> - </qresource> -</RCC> diff --git a/examples/quick/externaldraganddrop/main.cpp b/examples/quick/externaldraganddrop/main.cpp deleted file mode 100644 index cd4831018c..0000000000 --- a/examples/quick/externaldraganddrop/main.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#include "../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(externaldraganddrop/externaldraganddrop) |