From 27d22c5f4201c7555b42e187252bee3fd88d3821 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 13 Jun 2013 15:13:32 +0200 Subject: Doc: Move Qt Quick 1 demos and their documentation When installing the examples, we currently end up with a QT_INSTALL_EXAMPLES/demos directory with nothing but documentation files. This change moves the docs and also the demos themselves into examples/declarative/demos. Also fixes the links in demo .qdoc files. Task-number: QTBUG-31722 Change-Id: Ied15526be1db8437e14be786ea69eae98af8dd3f Reviewed-by: Jerome Pasion --- examples/declarative/demos/twitter/main.cpp | 55 +++++++++ .../twitter/qml/twitter/TwitterCore/Button.qml | 90 ++++++++++++++ .../qml/twitter/TwitterCore/FatDelegate.qml | 105 ++++++++++++++++ .../twitter/qml/twitter/TwitterCore/Input.qml | 65 ++++++++++ .../twitter/qml/twitter/TwitterCore/Loading.qml | 49 ++++++++ .../qml/twitter/TwitterCore/MultiTitleBar.qml | 60 +++++++++ .../twitter/qml/twitter/TwitterCore/RssModel.qml | 76 ++++++++++++ .../twitter/qml/twitter/TwitterCore/SearchView.qml | 124 +++++++++++++++++++ .../twitter/qml/twitter/TwitterCore/TitleBar.qml | 130 ++++++++++++++++++++ .../twitter/qml/twitter/TwitterCore/ToolBar.qml | 64 ++++++++++ .../twitter/qml/twitter/TwitterCore/UserModel.qml | 65 ++++++++++ .../qml/twitter/TwitterCore/images/gloss.png | Bin 0 -> 1236 bytes .../qml/twitter/TwitterCore/images/lineedit.png | Bin 0 -> 1415 bytes .../qml/twitter/TwitterCore/images/lineedit.sci | 5 + .../qml/twitter/TwitterCore/images/loading.png | Bin 0 -> 813 bytes .../qml/twitter/TwitterCore/images/quit.png | Bin 0 -> 2369 bytes .../qml/twitter/TwitterCore/images/stripes.png | Bin 0 -> 257 bytes .../qml/twitter/TwitterCore/images/titlebar.png | Bin 0 -> 1436 bytes .../qml/twitter/TwitterCore/images/titlebar.sci | 5 + .../qml/twitter/TwitterCore/images/toolbutton.png | Bin 0 -> 2550 bytes .../qml/twitter/TwitterCore/images/toolbutton.sci | 5 + .../demos/twitter/qml/twitter/TwitterCore/qmldir | 10 ++ .../demos/twitter/qml/twitter/twitter.qml | 134 +++++++++++++++++++++ examples/declarative/demos/twitter/twitter.desktop | 11 ++ examples/declarative/demos/twitter/twitter.pro | 24 ++++ .../declarative/demos/twitter/twitter.qmlproject | 16 +++ examples/declarative/demos/twitter/twitter.svg | 93 ++++++++++++++ examples/declarative/demos/twitter/twitter64.png | Bin 0 -> 3400 bytes examples/declarative/demos/twitter/twitter80.png | Bin 0 -> 4945 bytes .../demos/twitter/twitter_harmattan.desktop | 11 ++ 30 files changed, 1197 insertions(+) create mode 100644 examples/declarative/demos/twitter/main.cpp create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir create mode 100644 examples/declarative/demos/twitter/qml/twitter/twitter.qml create mode 100644 examples/declarative/demos/twitter/twitter.desktop create mode 100644 examples/declarative/demos/twitter/twitter.pro create mode 100644 examples/declarative/demos/twitter/twitter.qmlproject create mode 100644 examples/declarative/demos/twitter/twitter.svg create mode 100644 examples/declarative/demos/twitter/twitter64.png create mode 100644 examples/declarative/demos/twitter/twitter80.png create mode 100644 examples/declarative/demos/twitter/twitter_harmattan.desktop (limited to 'examples/declarative/demos/twitter') diff --git a/examples/declarative/demos/twitter/main.cpp b/examples/declarative/demos/twitter/main.cpp new file mode 100644 index 00000000..0a7a07f9 --- /dev/null +++ b/examples/declarative/demos/twitter/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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 "qmlapplicationviewer.h" +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/twitter/twitter.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml new file mode 100644 index 00000000..794ba267 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + signal clicked + + property string text + property bool keyUsing: false + + BorderImage { + id: buttonImage + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + BorderImage { + id: pressed + opacity: 0 + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + MouseArea { + id: mouseRegion + anchors.fill: buttonImage + onClicked: { container.clicked(); } + } + Text { + id: btnText + color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";} + anchors.centerIn: buttonImage; font.bold: true + text: container.text; style: Text.Raised; styleColor: "black" + font.pixelSize: 12 + } + states: [ + State { + name: "Pressed" + when: mouseRegion.pressed == true + PropertyChanges { target: pressed; opacity: 1 } + }, + State { + name: "Focused" + when: container.activeFocus == true + PropertyChanges { target: btnText; color: "#FFFFFF" } + } + ] + transitions: Transition { + ColorAnimation { target: btnText; } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml new file mode 100644 index 00000000..08a01c09 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Component { + id: listDelegate + Item { + id: wrapper; width: wrapper.ListView.view.width; height: if(txt.height > 60){txt.height+10}else{60} //50+5+5 + function handleLink(link){ + if(link.slice(0,3) == 'app'){ + screen.setUser(link.slice(7)); + }else if(link.slice(0,4) == 'http'){ + Qt.openUrlExternally(link); + } + } + function addTags(str){ + var ret = str.replace(/@[a-zA-Z0-9_]+/g, '$&');//click to jump to user? + var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '$&');//surrounds http links with html link tags + return ret2; + } + + // Strip away paranthesis + function userName(str) { + var user = str.replace(/\([\S|\s]*\)/gi, ""); + return user.trim(); + } + + Item { + id: moveMe; height: parent.height + Rectangle { + id: blackRect + color: "black"; opacity: wrapper.ListView.index % 2 ? 0.2 : 0.3; height: wrapper.height-2; width: wrapper.width; y: 1 + } + Item { + id: image; x: 6; width: 48; height: 48; smooth: true + anchors.verticalCenter: parent.verticalCenter + + Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != Image.Ready } + Image { + id: realImage; + source: userImage; x: 1; y: 1; + width:48; height:48; opacity:0 ; + onStatusChanged: { + if(status==Image.Ready) + image.state="loaded" + } + } + states: State { + name: "loaded"; + PropertyChanges { target: realImage ; opacity:1 } + } + transitions: Transition { NumberAnimation { target: realImage; property: "opacity"; duration: 200 } } + + } + Text { id:txt; y:4; x: 56 + text: '' + + ''+userName(name) + " from " +source + + "
" + statusText + ""; + textFormat: Qt.RichText + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap + anchors.left: image.right; anchors.right: blackRect.right; anchors.leftMargin: 6; anchors.rightMargin: 6 + onLinkActivated: wrapper.handleLink(link) + } + } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml new file mode 100644 index 00000000..aa090407 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +FocusScope { + id:container + width: 220 + height: 28 + BorderImage { source: "images/lineedit.sci"; anchors.fill: parent } + signal accepted + property alias text: input.text + property alias item:input + TextInput{ + id: input + width: parent.width - 12 + anchors.centerIn: parent + maximumLength:21 + font.pixelSize: 16; + font.bold: true + color: "#151515"; selectionColor: "mediumseagreen" + focus: true + onAccepted:{container.accepted()} + text: "" + selectByMouse: true + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml new file mode 100644 index 00000000..8520e150 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + id: loading; source: "images/loading.png" + NumberAnimation on rotation { + from: 0; to: 360; running: loading.visible == true; loops: Animation.Infinite; duration: 900 + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml new file mode 100644 index 00000000..2f91399d --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + TitleBar { id: titleBar; width: parent.width; height: 60; + y: -80 + untaggedString: "Latest tweets from everyone" + taggedString: "Latest tweets from " + } + states: [ + State { + name: "search"; when: screen.state!="search" + PropertyChanges { target: titleBar; y: 0 } + } + ] + transitions: [ + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } + ] +} + diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml new file mode 100644 index 00000000..1d2fe52b --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { id: wrapper + property variant model: xmlModel + property string from : "" + property string to : "" + property string phrase : "" + + property string mode : "everyone" + property int status: xmlModel.status + function reload() { xmlModel.reload(); } + XmlListModel { + id: xmlModel + + source: (from=="" && to=="" && phrase=="") ? "" : + 'http://search.twitter.com/search.atom?from='+from+"&to="+to+"&phrase="+phrase + + namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom'; " + + "declare namespace twitter=\"http://api.twitter.com/\";"; + + query: "/feed/entry" + + XmlRole { name: "statusText"; query: "content/string()" } + XmlRole { name: "timestamp"; query: "published/string()" } + XmlRole { name: "source"; query: "twitter:source/string()" } + XmlRole { name: "name"; query: "author/name/string()" } + XmlRole { name: "userImage"; query: "link[@rel = 'image']/@href/string()" } + + } + Binding { + property: "mode" + target: wrapper + value: {if(wrapper.tags==''){"everyone";}else if(wrapper.tags=='my timeline'){"self";}else{"user";}} + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml new file mode 100644 index 00000000..3991f06b --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +FocusScope { + id: wrapper + Column { + anchors.centerIn: parent + spacing: 20 + Column{ + spacing: 4 + Text { + text: "Posted by:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: fromIn + KeyNavigation.backtab: searchbutton + KeyNavigation.tab:toIn + onAccepted:searchbutton.doSearch(); + focus: true + } + Text { + text: "In reply to:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: toIn + KeyNavigation.backtab: fromIn + KeyNavigation.tab:phraseIn + onAccepted:searchbutton.doSearch(); + } + Text { + text: "Search phrase:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: phraseIn + KeyNavigation.backtab: toIn + KeyNavigation.tab:searchbutton + onAccepted:searchbutton.doSearch(); + text: "Qt Quick" + } + } + Button { + width: 100 + height: 32 + id: searchbutton + keyUsing: true; + opacity: 1 + text: "Search" + KeyNavigation.tab: fromIn + Keys.onReturnPressed: searchbutton.doSearch(); + Keys.onEnterPressed: searchbutton.doSearch(); + Keys.onSelectPressed: searchbutton.doSearch(); + Keys.onSpacePressed: searchbutton.doSearch(); + onClicked: searchbutton.doSearch(); + + function doSearch() { + // Search ! allowed + if (wrapper.state=="invalidinput") + return; + + rssModel.from=fromIn.text; + rssModel.to= toIn.text; + rssModel.phrase = phraseIn.text; + screen.focus = true; + screen.state = "" + } + } + } + states: + State { + name: "invalidinput" + when: fromIn.text=="" && toIn.text=="" && phraseIn.text=="" + PropertyChanges { target: searchbutton ; opacity: 0.6 ; } + } + transitions: + Transition { + NumberAnimation { target: searchbutton; property: "opacity"; duration: 200 } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml new file mode 100644 index 00000000..343e8797 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: titleBar + property string untaggedString: "Uploads from everyone" + property string taggedString: "Recent uploads tagged " + + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + + Item { + id: container + width: (parent.width * 2) - 55 ; height: parent.height + + function accept() { + titleBar.state = "" + background.state = "" + rssModel.tags = editor.text + } + + Item { + id:imageBox + x: 6; width: 0; height: 50; smooth: true + anchors.verticalCenter: parent.verticalCenter + + UserModel { user: rssModel.from; id: userModel } + Component { + id: imgDelegate; + Item { + id:imageitem + visible:true + Loading { width:48; height:48; visible: realImage.status != Image.Ready } + Image { id: realImage; source: image; width:48; height:48; opacity:0; } + states: + State { + name: "loaded" + when: (realImage.status == Image.Ready) + PropertyChanges { target: realImage; opacity:1 } + } + transitions: Transition { + NumberAnimation { target: realImage; property: "opacity"; duration: 200 } + } + } + } + ListView { id:view; model: userModel.model; x:1; y:1; delegate: imgDelegate } + states: + State { + when: !userModel.user=="" + PropertyChanges { target: imageBox; width: 50; } + } + transitions: + Transition { + NumberAnimation { target: imageBox; property: "width"; duration: 200 } + } + } + + Image { + id: quitButton + x: 5 + anchors.verticalCenter: parent.verticalCenter + source: "images/quit.png" + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + } + + Text { + id: categoryText + anchors { + left: quitButton.right; right: parent.right; leftMargin: 10; rightMargin: 10 + verticalCenter: parent.verticalCenter + } + elide: Text.ElideLeft + text: (rssModel.from=="" ? untaggedString : taggedString + rssModel.from) + font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black" + font.pixelSize: 12 + } + } + + states: State { + name: "Tags" + PropertyChanges { target: container; x: -tagButton.x + 5 } + PropertyChanges { target: editor; focus: true } + } + + transitions: Transition { + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml new file mode 100644 index 00000000..1b0df39a --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: toolbar + + property alias button1Label: button1.text + property alias button2Label: button2.text + signal button1Clicked + signal button2Clicked + focus:true + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + Button { + id: button1 + anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 32 + onClicked: toolbar.button1Clicked() + focus:true + } + Button { + id: button2 + anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 32 + onClicked: toolbar.button2Clicked() + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml new file mode 100644 index 00000000..0f5b48d0 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 + +//This "model" gets the user information about the searched user. Mainly for the icon. + +Item { id: wrapper + property variant model: xmlModel + property string user : "" + property int status: xmlModel.status + function reload() { xmlModel.reload(); } + XmlListModel { + id: xmlModel + + source: user!= "" ? "http://twitter.com/users/show.xml?screen_name="+user : "" + query: "/user" + + XmlRole { name: "name"; query: "name/string()" } + XmlRole { name: "screenName"; query: "screen_name/string()" } + XmlRole { name: "image"; query: "profile_image_url/string()" } + XmlRole { name: "location"; query: "location/string()" } + XmlRole { name: "description"; query: "description/string()" } + XmlRole { name: "followers"; query: "followers_count/string()" } + //TODO: Could also get the user's color scheme, timezone and a few other things + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png new file mode 100644 index 00000000..5d370cd9 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png new file mode 100644 index 00000000..2cc38dc3 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci new file mode 100644 index 00000000..054bff78 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci @@ -0,0 +1,5 @@ +border.left: 10 +border.top: 10 +border.bottom: 10 +border.right: 10 +source: lineedit.png diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png new file mode 100644 index 00000000..47a1589c Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png new file mode 100644 index 00000000..5bda1b6e Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png new file mode 100644 index 00000000..9f36727e Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png new file mode 100644 index 00000000..51c90082 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci new file mode 100644 index 00000000..0418d94c --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci @@ -0,0 +1,5 @@ +border.left: 10 +border.top: 12 +border.bottom: 12 +border.right: 10 +source: titlebar.png diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png new file mode 100644 index 00000000..11310013 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci new file mode 100644 index 00000000..9e4f9653 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci @@ -0,0 +1,5 @@ +border.left: 15 +border.top: 4 +border.bottom: 4 +border.right: 15 +source: toolbutton.png diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir new file mode 100644 index 00000000..84d85c28 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir @@ -0,0 +1,10 @@ +SearchView 1.0 SearchView.qml +Button 1.0 Button.qml +Input 1.0 Input.qml +FatDelegate 1.0 FatDelegate.qml +Loading 1.0 Loading.qml +MultiTitleBar 1.0 MultiTitleBar.qml +TitleBar 1.0 TitleBar.qml +RssModel 1.0 RssModel.qml +UserModel 1.0 UserModel.qml +ToolBar 1.0 ToolBar.qml diff --git a/examples/declarative/demos/twitter/qml/twitter/twitter.qml b/examples/declarative/demos/twitter/qml/twitter/twitter.qml new file mode 100644 index 00000000..8efc0765 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/twitter.qml @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications 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$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "TwitterCore" 1.0 as Twitter + +Item { + id: screen; width: 320; height: 480 + property bool userView : false + property variant tmpStr + function setUser(str){hack.running = true; tmpStr = str} + function reallySetUser(){rssModel.from = tmpStr;rssModel.to = ""; rssModel.phrase = ""} + state:"searchquery" + //Workaround for bug 260266 + Timer{ interval: 1; running: false; repeat: false; onTriggered: screen.reallySetUser(); id:hack } + Keys.onEscapePressed: screen.state="searchquery" + Keys.onBacktabPressed: screen.state="searchquery" + Rectangle { + id: background + anchors.fill: parent; color: "#343434"; + + state:"searchquery" + Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } + + MouseArea { + anchors.fill: parent + onClicked: screen.focus = false; + } + + Twitter.RssModel { id: rssModel } + Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'} + Text { + width: 180 + text: "Could not access twitter using this screen name and password pair."; + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap + visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent + } + + Item { + id: views + x: 2; width: parent.width - 4 + y:60 //Below the title bars + height: parent.height - 100 + + Text { + id:title + text: "Search Twitter" + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 20; font.bold: true; color: "#bbb"; style: Text.Raised; styleColor: "black" + opacity:0 + } + + Twitter.SearchView{ + id: searchView + anchors.verticalCenter: parent.verticalCenter + width: parent.width; height: parent.height-60; + x: -(screen.width * 1.5) + } + + Twitter.FatDelegate { id: fatDelegate } + ListView { + id: mainView; model: rssModel.model; delegate: fatDelegate; + width: parent.width; height: parent.height; x: 0; cacheBuffer: 100; + } + } + + Twitter.MultiTitleBar { id: titleBar; width: parent.width } + Twitter.ToolBar { id: toolBar; height: 40; + //anchors.bottom: parent.bottom; + //TODO: Use anchor changes instead of hard coding + y: screen.height - 40 + width: parent.width; opacity: 0.9 + button1Label: "New Search" + button2Label: "Update" + onButton1Clicked: + { + screen.state="searchquery" + } + onButton2Clicked: rssModel.reload(); + } + } + states: [ + State { + name: "searchquery"; + PropertyChanges { target: searchView; x: 0; focus:true} + PropertyChanges { target: mainView; x: -(parent.width * 1.5) } + PropertyChanges { target: titleBar; y: -80 } + PropertyChanges { target: toolBar; y: screen.height } + PropertyChanges { target: toolBar } + PropertyChanges { target: title; opacity:1} + } + ] + transitions: [ + Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutQuad } } + ] +} diff --git a/examples/declarative/demos/twitter/twitter.desktop b/examples/declarative/demos/twitter/twitter.desktop new file mode 100644 index 00000000..5d1b851b --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=twitter +Exec=/opt/twitter/bin/twitter +Icon=twitter64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/twitter/twitter.pro b/examples/declarative/demos/twitter/twitter.pro new file mode 100644 index 00000000..26d928ee --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.pro @@ -0,0 +1,24 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/twitter +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/twitter +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/twitter/twitter.qmlproject b/examples/declarative/demos/twitter/twitter.qmlproject new file mode 100644 index 00000000..3b360cf2 --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/twitter" + } + JavaScriptFiles { + directory: "qml/twitter" + } + ImageFiles { + directory: "qml/twitter" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/twitter/twitter.svg b/examples/declarative/demos/twitter/twitter.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/twitter/twitter64.png b/examples/declarative/demos/twitter/twitter64.png new file mode 100644 index 00000000..707d5c4e Binary files /dev/null and b/examples/declarative/demos/twitter/twitter64.png differ diff --git a/examples/declarative/demos/twitter/twitter80.png b/examples/declarative/demos/twitter/twitter80.png new file mode 100644 index 00000000..6ad8096c Binary files /dev/null and b/examples/declarative/demos/twitter/twitter80.png differ diff --git a/examples/declarative/demos/twitter/twitter_harmattan.desktop b/examples/declarative/demos/twitter/twitter_harmattan.desktop new file mode 100644 index 00000000..40a4a1bc --- /dev/null +++ b/examples/declarative/demos/twitter/twitter_harmattan.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=twitter +Exec=/usr/bin/single-instance /opt/twitter/bin/twitter +Icon=/usr/share/icons/hicolor/80x80/apps/twitter80.png +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable -- cgit v1.2.3