aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/photosurface
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2018-06-16 10:32:34 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-07-12 20:23:24 +0000
commitfa3c840ef1ff2100ccca6866528ac1f008c8e3a7 (patch)
treef5f54c46a177e8a6041796da99108e515e402526 /examples/quick/demos/photosurface
parent6c1ce43ce6399d7e40f4c57d3c9ca543ab760980 (diff)
Move demos to qtdoc repository
These demos use several modules and moving them allows to use for example Qt Quick Controls 2 in them. Change-Id: I1f352671dec672665e9fdb6a9c2a7c6e25a002b0 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'examples/quick/demos/photosurface')
-rw-r--r--examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.pngbin47271 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/doc/src/photosurface.qdoc157
-rw-r--r--examples/quick/demos/photosurface/main.cpp139
-rw-r--r--examples/quick/demos/photosurface/photosurface.pro13
-rw-r--r--examples/quick/demos/photosurface/photosurface.qml286
-rw-r--r--examples/quick/demos/photosurface/photosurface.qmlproject20
-rw-r--r--examples/quick/demos/photosurface/photosurface.qrc6
-rw-r--r--examples/quick/demos/photosurface/resources/folder.pngbin5851 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/icon.pngbin35894 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/photosurface.icnsbin47407 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/photosurface.icobin38623 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/photosurface.rc32
12 files changed, 0 insertions, 653 deletions
diff --git a/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png b/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
deleted file mode 100644
index a0cd823999..0000000000
--- a/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc b/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
deleted file mode 100644
index dd1b2fe79f..0000000000
--- a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - Photo Surface
- \ingroup qtquickdemos
- \example demos/photosurface
- \brief A QML app for touch devices that uses a Repeater with a
- FolderListModel to access content in a folder, and a PinchArea that contains
- a MouseArea to handle pinch gestures on the fetched content.
- \image qtquick-demo-photosurface-small.png
-
- \e{Photo Surface} demonstrates how to use a \l{Repeater} with a
- FolderListModel and a FileDialog to access images from a folder selected
- by a user and how to handle dragging, rotation and pinch zooming within the
- same item using a \l PinchArea that contains a \l MouseArea.
-
- All the app code is contained in one QML file, photosurface.qml. Inline
- JavaScript code is used to place, rotate, and scale images on the photo
- surface.
-
- \include examples-run.qdocinc
-
- \section1 Creating the Main Window
-
- To create the main window for the Photo Surface app, we use the \l{Window}
- QML type as the root item. It automatically sets up the window for use with
- \l{Qt Quick} graphical types:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto Window {
- \printuntil currentFrame
-
- To use the \l{Window} type, we must import it:
-
- \code
- import QtQuick.Window 2.1
- \endcode
-
- \section1 Accessing Folder Contents
-
- We use a \l{Repeater} QML type together with the FolderListModel to display
- GIF, JPG, and PNG images located in a folder:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto Repeater
- \printuntil }
-
- To use the FolderListModel type, we must import it:
-
- \code
- import Qt.labs.folderlistmodel 1.0
- \endcode
-
- We use a FileDialog to enable users to select the folder that contains
- the images:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto FileDialog
- \printuntil }
-
- To use the FileDialog type, we must import \l{Qt Quick Dialogs}:
-
- \code
- import QtQuick.Dialogs 1.0
- \endcode
-
- We use the \c {fileDialog.open()} function to open the file dialog when the
- app starts:
-
- \code
- Component.onCompleted: fileDialog.open()
- \endcode
-
- Users can also click the file dialog icon to open the file dialog. We use
- an \l{Image} QML type to display the icon. Inside the \l{Image} type, we
- use a MouseArea with the \c onClicked signal handler to call the
- \c {fileDialog.open()} function:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipuntil Image {
- \skipto Image {
- \printuntil }
- \printuntil }
-
- \section1 Displaying Images on the Photo Surface
-
- We use a \l{Rectangle} as a delegate for a \l{Repeater} to provide a frame
- for each image that the FolderListModel finds in the selected folder. We use
- JavaScript \c Math() methods to place the frames randomly on the photo
- surface and to rotate them at random angles, as well as to scale the images:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto Rectangle
- \printuntil Component.onCompleted
- \printuntil }
-
- \section1 Handling Pinch Gestures
-
- We use a PinchArea that contains a MouseArea in the photo frames to handle
- dragging, rotation and pinch zooming of the frame:
-
- \skipto PinchArea
- \printuntil onPinchStarted
-
- We use the \c pinch group property to control how the photo frames react to
- pinch gestures. The \c pinch.target sets \c photoFrame as the item to
- manipulate. The rotation properties specify that the frames can be rotated
- at all angles and the scale properties specify that they can be scaled
- between \c 0.1 and \c 10.
-
- In the MouseArea's \c onPressed signal handler, we raise the selected photo
- frame to the top by increasing the value of its \c z property. The root item
- stores the z value of the top-most frame. The border color of the photo
- frame is controlled in the \c onEntered signal handler to highlight the
- selected image:
-
- \skipto MouseArea
- \printuntil onEntered
-
- To enable you to test the example on the desktop, we use the MouseArea's
- \c onWheel signal handler to simulate pinch gestures by using a mouse:
-
- \printuntil photoFrame.scale
- \printuntil }
- \printuntil }
-
- The \c onWheel signal handler is called in response to mouse wheel gestures.
- Use the vertical wheel to zoom and Ctrl and the vertical wheel to rotate
- frames. If the mouse has a horizontal wheel, use it to rotate frames.
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/photosurface/main.cpp b/examples/quick/demos/photosurface/main.cpp
deleted file mode 100644
index d1522bd09c..0000000000
--- a/examples/quick/demos/photosurface/main.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifdef QT_WIDGETS_LIB
-#include <QtWidgets/QApplication>
-#else
-#include <QtGui/QGuiApplication>
-#endif
-#include <QtQml/QQmlApplicationEngine>
-#include <QtQml/QQmlContext>
-#include <QtQuick/QQuickWindow>
-#include <QtGui/QImageReader>
-#include <QtCore/QCommandLineParser>
-#include <QtCore/QCommandLineOption>
-#include <QtCore/QDebug>
-#include <QtCore/QDir>
-#include <QtCore/QMimeDatabase>
-#include <QtCore/QStandardPaths>
-#include <QtCore/QUrl>
-
-static QStringList imageNameFilters()
-{
- QStringList result;
- QMimeDatabase mimeDatabase;
- const auto supportedMimeTypes = QImageReader::supportedMimeTypes();
- for (const QByteArray &m : supportedMimeTypes) {
- const auto suffixes = mimeDatabase.mimeTypeForName(m).suffixes();
- for (const QString &suffix : suffixes)
- result.append(QLatin1String("*.") + suffix);
- }
- return result;
-}
-
-int main(int argc, char* argv[])
-{
- // The reason to use QApplication is that QWidget-based dialogs
- // are the native dialogs on Qt-based platforms like KDE,
- // but they cannot be instantiated if this is a QGuiApplication.
-#ifdef QT_WIDGETS_LIB
- QApplication app(argc, argv);
-#else
- QGuiApplication app(argc, argv);
-#endif
- QQuickWindow::setDefaultAlphaBuffer(true);
-
- QCoreApplication::setApplicationName(QStringLiteral("Photosurface"));
- QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
- QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR));
- QCommandLineParser parser;
- parser.setApplicationDescription(QStringLiteral("Qt Quick Demo - Photo Surface"));
- parser.addHelpOption();
- parser.addVersionOption();
- parser.addPositionalArgument(QStringLiteral("directory"),
- QStringLiteral("The image directory or URL to show."));
- parser.process(app);
-
- QUrl initialUrl;
- if (!parser.positionalArguments().isEmpty()) {
- initialUrl = QUrl::fromUserInput(parser.positionalArguments().first(),
- QDir::currentPath(), QUrl::AssumeLocalFile);
- if (!initialUrl.isValid()) {
- qWarning().nospace() << "Invalid argument: \""
- << parser.positionalArguments().first() << "\": " << initialUrl.errorString();
- return 1;
- }
- }
-
- const QStringList nameFilters = imageNameFilters();
-
- QQmlApplicationEngine engine;
- QQmlContext *context = engine.rootContext();
-
- QUrl picturesLocationUrl = QUrl::fromLocalFile(QDir::homePath());
- const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
- if (!picturesLocations.isEmpty()) {
- picturesLocationUrl = QUrl::fromLocalFile(picturesLocations.first());
- if (initialUrl.isEmpty()
- && !QDir(picturesLocations.first()).entryInfoList(nameFilters, QDir::Files).isEmpty()) {
- initialUrl = picturesLocationUrl;
- }
- }
-
- context->setContextProperty(QStringLiteral("contextPicturesLocation"), picturesLocationUrl);
- context->setContextProperty(QStringLiteral("contextInitialUrl"), initialUrl);
- context->setContextProperty(QStringLiteral("contextImageNameFilters"), nameFilters);
-
- engine.load(QUrl("qrc:///photosurface.qml"));
- if (engine.rootObjects().isEmpty())
- return -1;
-
- return app.exec();
-}
diff --git a/examples/quick/demos/photosurface/photosurface.pro b/examples/quick/demos/photosurface/photosurface.pro
deleted file mode 100644
index 5e5b0f0815..0000000000
--- a/examples/quick/demos/photosurface/photosurface.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick
-qtHaveModule(widgets): QT += widgets
-SOURCES += main.cpp
-RESOURCES += photosurface.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/photosurface
-INSTALLS += target
-ICON = resources/icon.png
-macx: ICON = resources/photosurface.icns
-win32: RC_FILE = resources/photosurface.rc
-
diff --git a/examples/quick/demos/photosurface/photosurface.qml b/examples/quick/demos/photosurface/photosurface.qml
deleted file mode 100644
index 5d1445d776..0000000000
--- a/examples/quick/demos/photosurface/photosurface.qml
+++ /dev/null
@@ -1,286 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Dialogs 1.0
-import QtQuick.Window 2.1
-import Qt.labs.folderlistmodel 1.0
-
-Window {
- id: root
- visible: true
- width: 1024; height: 600
- color: "black"
- property int highestZ: 0
- property real defaultSize: 200
- property var currentFrame: undefined
- property real surfaceViewportRatio: 1.5
-
- FileDialog {
- id: fileDialog
- title: "Choose a folder with some images"
- selectFolder: true
- folder: picturesLocation
- onAccepted: folderModel.folder = fileUrl + "/"
- }
-
- Flickable {
- id: flick
- anchors.fill: parent
- contentWidth: width * surfaceViewportRatio
- contentHeight: height * surfaceViewportRatio
- Repeater {
- model: FolderListModel {
- id: folderModel
- objectName: "folderModel"
- showDirs: false
- nameFilters: imageNameFilters
- }
- Rectangle {
- id: photoFrame
- width: image.width * (1 + 0.10 * image.height / image.width)
- height: image.height * 1.10
- scale: defaultSize / Math.max(image.sourceSize.width, image.sourceSize.height)
- Behavior on scale { NumberAnimation { duration: 200 } }
- Behavior on x { NumberAnimation { duration: 200 } }
- Behavior on y { NumberAnimation { duration: 200 } }
- border.color: "black"
- border.width: 2
- smooth: true
- antialiasing: true
- Component.onCompleted: {
- x = Math.random() * root.width - width / 2
- y = Math.random() * root.height - height / 2
- rotation = Math.random() * 13 - 6
- }
- Image {
- id: image
- anchors.centerIn: parent
- fillMode: Image.PreserveAspectFit
- source: folderModel.folder + fileName
- antialiasing: true
- }
- PinchArea {
- anchors.fill: parent
- pinch.target: photoFrame
- pinch.minimumRotation: -360
- pinch.maximumRotation: 360
- pinch.minimumScale: 0.1
- pinch.maximumScale: 10
- pinch.dragAxis: Pinch.XAndYAxis
- onPinchStarted: setFrameColor();
- property real zRestore: 0
- onSmartZoom: {
- if (pinch.scale > 0) {
- photoFrame.rotation = 0;
- photoFrame.scale = Math.min(root.width, root.height) / Math.max(image.sourceSize.width, image.sourceSize.height) * 0.85
- photoFrame.x = flick.contentX + (flick.width - photoFrame.width) / 2
- photoFrame.y = flick.contentY + (flick.height - photoFrame.height) / 2
- zRestore = photoFrame.z
- photoFrame.z = ++root.highestZ;
- } else {
- photoFrame.rotation = pinch.previousAngle
- photoFrame.scale = pinch.previousScale
- photoFrame.x = pinch.previousCenter.x - photoFrame.width / 2
- photoFrame.y = pinch.previousCenter.y - photoFrame.height / 2
- photoFrame.z = zRestore
- --root.highestZ
- }
- }
-
- MouseArea {
- id: dragArea
- hoverEnabled: true
- anchors.fill: parent
- drag.target: photoFrame
- scrollGestureEnabled: false // 2-finger-flick gesture should pass through to the Flickable
- onPressed: {
- photoFrame.z = ++root.highestZ;
- parent.setFrameColor();
- }
- onEntered: parent.setFrameColor();
- onWheel: {
- if (wheel.modifiers & Qt.ControlModifier) {
- photoFrame.rotation += wheel.angleDelta.y / 120 * 5;
- if (Math.abs(photoFrame.rotation) < 4)
- photoFrame.rotation = 0;
- } else {
- photoFrame.rotation += wheel.angleDelta.x / 120;
- if (Math.abs(photoFrame.rotation) < 0.6)
- photoFrame.rotation = 0;
- var scaleBefore = photoFrame.scale;
- photoFrame.scale += photoFrame.scale * wheel.angleDelta.y / 120 / 10;
- }
- }
- }
- function setFrameColor() {
- if (currentFrame)
- currentFrame.border.color = "black";
- currentFrame = photoFrame;
- currentFrame.border.color = "red";
- }
- }
- }
- }
- }
-
- Rectangle {
- id: verticalScrollDecorator
- anchors.right: parent.right
- anchors.margins: 2
- color: "cyan"
- border.color: "black"
- border.width: 1
- width: 5
- radius: 2
- antialiasing: true
- height: flick.height * (flick.height / flick.contentHeight) - (width - anchors.margins) * 2
- y: (flick.contentY - flick.originY) * (flick.height / flick.contentHeight)
- NumberAnimation on opacity { id: vfade; to: 0; duration: 500 }
- onYChanged: { opacity = 1.0; scrollFadeTimer.restart() }
- }
-
- Rectangle {
- id: horizontalScrollDecorator
- anchors.bottom: parent.bottom
- anchors.margins: 2
- color: "cyan"
- border.color: "black"
- border.width: 1
- height: 5
- radius: 2
- antialiasing: true
- width: flick.width * (flick.width / flick.contentWidth) - (height - anchors.margins) * 2
- x: (flick.contentX - flick.originY) * (flick.width / flick.contentWidth)
- NumberAnimation on opacity { id: hfade; to: 0; duration: 500 }
- onXChanged: { opacity = 1.0; scrollFadeTimer.restart() }
- }
-
- Timer { id: scrollFadeTimer; interval: 1000; onTriggered: { hfade.start(); vfade.start() } }
-
- Image {
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.margins: 10
- source: "resources/folder.png"
- MouseArea {
- anchors.fill: parent
- anchors.margins: -10
- onClicked: fileDialog.open()
- hoverEnabled: true
- onPositionChanged: {
- tooltip.visible = false
- hoverTimer.start()
- }
- onExited: {
- tooltip.visible = false
- hoverTimer.stop()
- }
- Timer {
- id: hoverTimer
- interval: 1000
- onTriggered: {
- tooltip.x = parent.mouseX
- tooltip.y = parent.mouseY
- tooltip.visible = true
- }
- }
- Rectangle {
- id: tooltip
- border.color: "black"
- color: "beige"
- width: tooltipText.implicitWidth + 8
- height: tooltipText.implicitHeight + 8
- visible: false
- Text {
- id: tooltipText
- anchors.centerIn: parent
- text: "Open an image directory (" + openShortcut.sequenceString + ")"
- }
- }
- }
- Shortcut {
- id: openShortcut
- sequence: StandardKey.Open
- onActivated: fileDialog.open()
- }
- }
-
- Text {
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: 10
- color: "darkgrey"
- wrapMode: Text.WordWrap
- font.pointSize: 8
- text: "On a touchscreen: use two fingers to zoom and rotate, one finger to drag\n" +
- "With a mouse: drag normally, use the vertical wheel to zoom, horizontal wheel to rotate, or hold Ctrl while using the vertical wheel to rotate"
- }
-
- Shortcut { sequence: StandardKey.Quit; onActivated: Qt.quit() }
-
- Component.onCompleted: {
- if (typeof contextInitialUrl !== 'undefined') {
- // Launched from C++ with context properties set.
- imageNameFilters = contextImageNameFilters;
- picturesLocation = contextPicturesLocation;
- if (contextInitialUrl == "")
- fileDialog.open();
- else
- folderModel.folder = contextInitialUrl + "/";
- } else {
- // Launched via QML viewer without context properties set.
- fileDialog.open();
- }
- }
-
- property var imageNameFilters : ["*.png", "*.jpg", "*.gif"];
- property string picturesLocation : "";
-}
diff --git a/examples/quick/demos/photosurface/photosurface.qmlproject b/examples/quick/demos/photosurface/photosurface.qmlproject
deleted file mode 100644
index ae2065f59c..0000000000
--- a/examples/quick/demos/photosurface/photosurface.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "photosurface.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- Files {
- filter: "*.ts"
- directory: "i18n"
- }
-}
diff --git a/examples/quick/demos/photosurface/photosurface.qrc b/examples/quick/demos/photosurface/photosurface.qrc
deleted file mode 100644
index f8fafbb1ff..0000000000
--- a/examples/quick/demos/photosurface/photosurface.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>photosurface.qml</file>
- <file>resources/folder.png</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/photosurface/resources/folder.png b/examples/quick/demos/photosurface/resources/folder.png
deleted file mode 100644
index 2aec3b6ebf..0000000000
--- a/examples/quick/demos/photosurface/resources/folder.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/icon.png b/examples/quick/demos/photosurface/resources/icon.png
deleted file mode 100644
index f8ff553fcb..0000000000
--- a/examples/quick/demos/photosurface/resources/icon.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/photosurface.icns b/examples/quick/demos/photosurface/resources/photosurface.icns
deleted file mode 100644
index c69ec41c4e..0000000000
--- a/examples/quick/demos/photosurface/resources/photosurface.icns
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/photosurface.ico b/examples/quick/demos/photosurface/resources/photosurface.ico
deleted file mode 100644
index 03bb7ee367..0000000000
--- a/examples/quick/demos/photosurface/resources/photosurface.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/photosurface.rc b/examples/quick/demos/photosurface/resources/photosurface.rc
deleted file mode 100644
index 3267bd033f..0000000000
--- a/examples/quick/demos/photosurface/resources/photosurface.rc
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "winver.h"
-
-IDI_ICON1 ICON DISCARDABLE "photosurface.ico"
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 1,0,0,0
- FILEFLAGS 0x0L
- FILEFLAGSMASK 0x3fL
- FILEOS 0x00040004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "000004b0"
- BEGIN
- VALUE "CompanyName", "The Qt Company Ltd"
- VALUE "FileDescription", "Photo Surface Demo"
- VALUE "FileVersion", "1.0.0.0"
- VALUE "LegalCopyright", "Copyright (C) 2015 The Qt Company Ltd."
- VALUE "InternalName", "photosurface"
- VALUE "OriginalFilename", "photosurface.exe"
- VALUE "ProductName", "Photo Surface Demo"
- VALUE "ProductVersion", "1.0.0.0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x0, 1200
- END
-END