From 7ccdf8d11675e963b70b565e421309e09c019343 Mon Sep 17 00:00:00 2001 From: Niels Weber Date: Mon, 12 May 2014 13:27:24 +0200 Subject: [PATCH] Make a pro file based project out of the photoviewer example Having a .pro file project is necessary to be able to deploy to Android. Further patches for Android support will be needed, but this is the base. Task-number: QTBUG-38122 Change-Id: I878ec1df50d7375ae9153f8a34f763b5678d7774 Reviewed-by: Mika Salmela Reviewed-by: Sami Makkonen Reviewed-by: Tim Jenssen --- .../quick/demos/photoviewer/PhotoViewerCore/qmldir | 8 --- examples/quick/demos/photoviewer/deployment.pri | 23 ++++++++ examples/quick/demos/photoviewer/i18n/base.ts | 30 ----------- examples/quick/demos/photoviewer/i18n/qml_de.qm | Bin 0 -> 310 bytes examples/quick/demos/photoviewer/i18n/qml_de.ts | 35 ++++++++++++ examples/quick/demos/photoviewer/i18n/qml_fr.qm | Bin 268 -> 247 bytes examples/quick/demos/photoviewer/i18n/qml_fr.ts | 17 +++--- examples/quick/demos/photoviewer/main.cpp | 59 +++++++++++++++++++++ .../photoviewer/{photoviewer.qml => main.qml} | 9 ++-- examples/quick/demos/photoviewer/photoviewer.pro | 22 ++++++++ .../quick/demos/photoviewer/photoviewer.qmlproject | 20 ------- examples/quick/demos/photoviewer/qml.qrc | 19 +++++++ 12 files changed, 175 insertions(+), 67 deletions(-) delete mode 100644 examples/quick/demos/photoviewer/PhotoViewerCore/qmldir create mode 100644 examples/quick/demos/photoviewer/deployment.pri delete mode 100644 examples/quick/demos/photoviewer/i18n/base.ts create mode 100644 examples/quick/demos/photoviewer/i18n/qml_de.qm create mode 100644 examples/quick/demos/photoviewer/i18n/qml_de.ts create mode 100644 examples/quick/demos/photoviewer/main.cpp rename examples/quick/demos/photoviewer/{photoviewer.qml => main.qml} (96%) create mode 100644 examples/quick/demos/photoviewer/photoviewer.pro delete mode 100644 examples/quick/demos/photoviewer/photoviewer.qmlproject create mode 100644 examples/quick/demos/photoviewer/qml.qrc diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/qmldir b/examples/quick/demos/photoviewer/PhotoViewerCore/qmldir deleted file mode 100644 index d3c247f..0000000 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/qmldir +++ /dev/null @@ -1,8 +0,0 @@ -AlbumDelegate AlbumDelegate.qml -PhotoDelegate PhotoDelegate.qml -ProgressBar ProgressBar.qml -RssModel RssModel.qml -BusyIndicator BusyIndicator.qml -EditableButton EditableButton.qml -Button Button.qml -Tag Tag.qml diff --git a/examples/quick/demos/photoviewer/deployment.pri b/examples/quick/demos/photoviewer/deployment.pri new file mode 100644 index 0000000..839b3b5 --- /dev/null +++ b/examples/quick/demos/photoviewer/deployment.pri @@ -0,0 +1,23 @@ +android-no-sdk { + target.path = /data/user/qt + export(target.path) + INSTALLS += target +} else:android { + x86 { + target.path = /libs/x86 + } else: armeabi-v7a { + target.path = /libs/armeabi-v7a + } else { + target.path = /libs/armeabi + } + export(target.path) + INSTALLS += target +} else:unix { + isEmpty(target.path) { + target.path = /opt/$${TARGET}/bin + export(target.path) + } + INSTALLS += target +} + +export(INSTALLS) diff --git a/examples/quick/demos/photoviewer/i18n/base.ts b/examples/quick/demos/photoviewer/i18n/base.ts deleted file mode 100644 index 1accfd2..0000000 --- a/examples/quick/demos/photoviewer/i18n/base.ts +++ /dev/null @@ -1,30 +0,0 @@ - - - - - AlbumDelegate - - - Remove - - - - - photoviewer - - - Add - - - - - Edit - - - - - Back - - - - diff --git a/examples/quick/demos/photoviewer/i18n/qml_de.qm b/examples/quick/demos/photoviewer/i18n/qml_de.qm new file mode 100644 index 0000000000000000000000000000000000000000..8186e7309fb722dc1d50cc7d7c7deac98bcc3b7f GIT binary patch literal 310 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJZgMq<)36Qp8U}>KXq*EAJcC!HKUIx}45WSDJ z$L%PPX2=BMx6D97h{2U1kD-JijUknx2*^rh$m0MhU<2Wx)ZF~CRCXYf*D)ulG}k3H zCpA5>B$W}QlaC>ap%kd^4?{YNE@sD+6p$8{+{Da0uu2}V$|9i3WQJ_G=`2o($=Rq1 zMHrlbMkN9rk_4nPfzCp94vT9_W(leWA%-xZk|Ks2pr&FVL{T1Cimbc?=p-gaMgXDZ BIBEa@ literal 0 HcmV?d00001 diff --git a/examples/quick/demos/photoviewer/i18n/qml_de.ts b/examples/quick/demos/photoviewer/i18n/qml_de.ts new file mode 100644 index 0000000..92ab50a --- /dev/null +++ b/examples/quick/demos/photoviewer/i18n/qml_de.ts @@ -0,0 +1,35 @@ + + + + + AlbumDelegate + + + Remove + Entfernen + + + + main + + + Add + Zufügen + + + + Edit + Bearbeiten + + + + Quit + Verlassen + + + + Back + Zurück + + + diff --git a/examples/quick/demos/photoviewer/i18n/qml_fr.qm b/examples/quick/demos/photoviewer/i18n/qml_fr.qm index c24fcbc46cd9730208a116ab3408cf6201b4e9e3..e4257d4073f2813059cf9f4b76c27db2cc3c8c9a 100644 GIT binary patch delta 64 zcmeBS`p!5(MJ$DZWj6~014A!skK0io&5#Mi+a_AYv9jbQX68*?q5@@HQQ-xPFm?bH IFflU%04A{zYybcN delta 85 zcmey)*uykIMJ$_vWj6~01H)|A9=D@FnjsU2PfxUp+`!iJ1`qMS2 - + AlbumDelegate - + Remove Supprimer - photoviewer + main - + Add Ajouter - + Edit Éditer - + + Quit + + + + Back Retour diff --git a/examples/quick/demos/photoviewer/main.cpp b/examples/quick/demos/photoviewer/main.cpp new file mode 100644 index 0000000..6ce7c1c --- /dev/null +++ b/examples/quick/demos/photoviewer/main.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QTranslator qtTranslator; + qtTranslator.load("qml_" + QLocale::system().name(), ":/i18n/"); + app.installTranslator(&qtTranslator); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); + + return app.exec(); +} diff --git a/examples/quick/demos/photoviewer/photoviewer.qml b/examples/quick/demos/photoviewer/main.qml similarity index 96% rename from examples/quick/demos/photoviewer/photoviewer.qml rename to examples/quick/demos/photoviewer/main.qml index df344ac..f443b70 100644 --- a/examples/quick/demos/photoviewer/photoviewer.qml +++ b/examples/quick/demos/photoviewer/main.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtQml module of the Qt Toolkit. @@ -39,13 +39,16 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.2 +import QtQuick.Controls 1.1 import QtQml.Models 2.1 import "PhotoViewerCore" -Rectangle { +ApplicationWindow { id: mainWindow + visible: true + property real downloadProgress: 0 property bool imageLoading: false property bool editMode: false diff --git a/examples/quick/demos/photoviewer/photoviewer.pro b/examples/quick/demos/photoviewer/photoviewer.pro new file mode 100644 index 0000000..704e2ce --- /dev/null +++ b/examples/quick/demos/photoviewer/photoviewer.pro @@ -0,0 +1,22 @@ +TEMPLATE = app + +QT += qml quick widgets xmlpatterns + +SOURCES += main.cpp + +lupdate_only{ +SOURCES = *.qml \ + PhotoViewerCore/*.qml \ + PhotoViewerCore/script/*.js +} + +TRANSLATIONS += i18n/qml_fr.ts \ + i18n/qml_de.ts + +RESOURCES += qml.qrc + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Default rules for deployment. +include(deployment.pri) diff --git a/examples/quick/demos/photoviewer/photoviewer.qmlproject b/examples/quick/demos/photoviewer/photoviewer.qmlproject deleted file mode 100644 index 600bdb1..0000000 --- a/examples/quick/demos/photoviewer/photoviewer.qmlproject +++ /dev/null @@ -1,20 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "photoviewer.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/photoviewer/qml.qrc b/examples/quick/demos/photoviewer/qml.qrc new file mode 100644 index 0000000..8abefc6 --- /dev/null +++ b/examples/quick/demos/photoviewer/qml.qrc @@ -0,0 +1,19 @@ + + + main.qml + PhotoViewerCore/AlbumDelegate.qml + PhotoViewerCore/BusyIndicator.qml + PhotoViewerCore/Button.qml + PhotoViewerCore/EditableButton.qml + PhotoViewerCore/PhotoDelegate.qml + PhotoViewerCore/ProgressBar.qml + PhotoViewerCore/RssModel.qml + PhotoViewerCore/Tag.qml + PhotoViewerCore/images/box-shadow.png + PhotoViewerCore/images/busy.png + PhotoViewerCore/images/cardboard.png + PhotoViewerCore/script/script.js + i18n/qml_fr.qm + i18n/qml_de.qm + + -- 2.7.4