Make the Clocks example use the resource system

Make the Clocks example use the Qt resource system and the
shared main(), in order to have easy deployment to all
platforms and support for shadow builds.

Task-number: QTBUG-37203
Change-Id: Ia235b6b2397cfaeb20f0c7ea0d6196c603b20099
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
This commit is contained in:
Topi Reinio 2014-04-22 13:32:56 +02:00 committed by The Qt Project
parent 93fd268d53
commit 937fdde5d3
5 changed files with 74 additions and 4 deletions

View File

@ -0,0 +1,14 @@
TEMPLATE = app
QT += qml quick
SOURCES += main.cpp
RESOURCES += clocks.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/clocks
INSTALLS += target
OTHER_FILES += \
clocks.qml \
content/Clock.qml \
content/*.png

View File

@ -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 examples of the Qt Toolkit.
@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
import "content"
import "content" as Content
Rectangle {
id: root
@ -54,7 +54,7 @@ Rectangle {
snapMode: ListView.SnapOneItem
highlightRangeMode: ListView.ApplyRange
delegate: Clock { city: cityName; shift: timeShift }
delegate: Content.Clock { city: cityName; shift: timeShift }
model: ListModel {
ListElement { cityName: "New York"; timeShift: -4 }
ListElement { cityName: "London"; timeShift: 0 }

View File

@ -0,0 +1,15 @@
<RCC>
<qresource prefix="/demos/clocks">
<file>clocks.qml</file>
<file>content/arrow.png</file>
<file>content/background.png</file>
<file>content/center.png</file>
<file>content/clock-night.png</file>
<file>content/clock.png</file>
<file>content/Clock.qml</file>
<file>content/hour.png</file>
<file>content/minute.png</file>
<file>content/quit.png</file>
<file>content/second.png</file>
</qresource>
</RCC>

View File

@ -0,0 +1,41 @@
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** 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 Digia Plc and its Subsidiary(-ies) 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$
**
****************************************************************************/
#include "../../shared/shared.h"
DECLARATIVE_EXAMPLE_MAIN(demos/clocks/clocks)

View File

@ -1,12 +1,12 @@
TEMPLATE = subdirs
SUBDIRS = samegame \
calqlatr \
clocks \
tweetsearch \
maroon \
photosurface \
stocqt
EXAMPLE_FILES = \
clocks \
photoviewer \
rssnews