aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/tweetsearch/content
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/demos/tweetsearch/content')
-rw-r--r--examples/quick/demos/tweetsearch/content/FlipBar.qml183
-rw-r--r--examples/quick/demos/tweetsearch/content/LineInput.qml108
-rw-r--r--examples/quick/demos/tweetsearch/content/ListFooter.qml164
-rw-r--r--examples/quick/demos/tweetsearch/content/ListHeader.qml91
-rw-r--r--examples/quick/demos/tweetsearch/content/SearchDelegate.qml135
-rw-r--r--examples/quick/demos/tweetsearch/content/TweetDelegate.qml199
-rw-r--r--examples/quick/demos/tweetsearch/content/TweetsModel.qml135
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/anonymous.pngbin1788 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.pngbin11079 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-clear.pngbin1166 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-loading.pngbin1542 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-refresh.pngbin1202 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-search.pngbin1284 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/tweetsearch.js62
14 files changed, 0 insertions, 1077 deletions
diff --git a/examples/quick/demos/tweetsearch/content/FlipBar.qml b/examples/quick/demos/tweetsearch/content/FlipBar.qml
deleted file mode 100644
index 608f5cc08b..0000000000
--- a/examples/quick/demos/tweetsearch/content/FlipBar.qml
+++ /dev/null
@@ -1,183 +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.0
-
-Item {
- id: container
- property int animDuration: 300
- property Item front: Item {}
- property Item back: Item {}
- property real factor: 0.1 // amount the edges fold in for the 3D effect
- property alias delta: effect.delta
- property Item cur: frontShown ? front : back
- property Item noncur: frontShown ? back : front
-
- function swap() {
- var tmp = front;
- front = back;
- back = tmp;
- resync();
- }
-
- width: cur.width
- height: cur.height
- onFrontChanged: resync();
- onBackChanged: resync();
-
- function resync() {//TODO: Are the items ever actually visible?
- back.parent = container;
- front.parent = container;
- frontShown ? back.visible = false : front.visible = false;
- }
-
- property bool frontShown: true
-
- onFrontShownChanged: {
- back.visible = !frontShown
- front.visible = frontShown
- }
-
- function flipUp(start) {
- effect.visible = true;
- effect.sourceA = effect.source1
- effect.sourceB = effect.source2
- if (start == undefined)
- start = 1.0;
- deltaAnim.from = start;
- deltaAnim.to = 0.0
- dAnim.start();
- frontShown = false;
- }
-
- function flipDown(start) {
- effect.visible = true;
- effect.sourceA = effect.source1
- effect.sourceB = effect.source2
- if (start == undefined)
- start = 0.0;
- deltaAnim.from = start;
- deltaAnim.to = 1.0
- dAnim.start();
- frontShown = true;
- }
-
- ShaderEffect {
- id: effect
- width: cur.width
- height: cur.height
- property real factor: container.factor * width
- property real delta: 1.0
-
- mesh: GridMesh { resolution: Qt.size(8,2) }
-
- SequentialAnimation on delta {
- id: dAnim
- running: false
- NumberAnimation {
- id: deltaAnim
- duration: animDuration//expose anim
- }
- }
-
- property variant sourceA: source1
- property variant sourceB: source1
- property variant source1: ShaderEffectSource {
- sourceItem: front
- hideSource: effect.visible
- }
-
- property variant source2: ShaderEffectSource {
- sourceItem: back
- hideSource: effect.visible
- }
-
- fragmentShader: "
- uniform lowp float qt_Opacity;
- uniform sampler2D sourceA;
- uniform sampler2D sourceB;
- uniform highp float delta;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec4 tex = vec4(qt_TexCoord0.x, qt_TexCoord0.y * 2.0, qt_TexCoord0.x, (qt_TexCoord0.y-0.5) * 2.0);
- highp float shade = clamp(delta*2.0, 0.5, 1.0);
- highp vec4 col;
- if (qt_TexCoord0.y < 0.5) {
- col = texture2D(sourceA, tex.xy) * (shade);
- } else {
- col = texture2D(sourceB, tex.zw) * (1.5 - shade);
- col.w = 1.0;
- }
- gl_FragColor = col * qt_Opacity;
- }
- "
- property real h: height
- vertexShader: "
- uniform highp float delta;
- uniform highp float factor;
- uniform highp float h;
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- attribute highp vec2 qt_MultiTexCoord0;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec4 pos = qt_Vertex;
- if (qt_MultiTexCoord0.y == 0.0)
- pos.x += factor * (1. - delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0);
- else if (qt_MultiTexCoord0.y == 1.0)
- pos.x += factor * (delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0);
- else
- pos.y = delta * h;
- gl_Position = qt_Matrix * pos;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
-
- }
-}
diff --git a/examples/quick/demos/tweetsearch/content/LineInput.qml b/examples/quick/demos/tweetsearch/content/LineInput.qml
deleted file mode 100644
index 1ef8fd9f5c..0000000000
--- a/examples/quick/demos/tweetsearch/content/LineInput.qml
+++ /dev/null
@@ -1,108 +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.0
-
-FocusScope {
- id: wrapper
-
- property alias text: input.text
- property alias hint: hint.text
- property alias prefix: prefix.text
-
- signal accepted
-
- Rectangle {
- anchors.fill: parent
- border.color: "#707070"
- color: "#c1c1c1"
- radius: 4
-
- Text {
- id: hint
- anchors { fill: parent; leftMargin: 14 }
- verticalAlignment: Text.AlignVCenter
- text: "Enter word"
- font.pixelSize: 18
- color: "#707070"
- opacity: input.displayText.length ? 0 : 1
- }
-
- Text {
- id: prefix
- anchors { left: parent.left; leftMargin: 14; verticalCenter: parent.verticalCenter }
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: 18
- color: "#707070"
- opacity: !hint.opacity
- }
-
- TextInput {
- id: input
- focus: true
- anchors { left: prefix.right; right: parent.right; top: parent.top; bottom: parent.bottom }
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: 18
- color: "#707070"
- onAccepted: wrapper.accepted()
- }
-
- Image {
- source: "resources/icon-search.png"
- anchors.right: parent.right
- anchors.rightMargin: 12
- anchors.verticalCenter: parent.verticalCenter
- MouseArea {
- anchors { fill: parent; margins: -10 }
- onClicked: wrapper.accepted()
- }
- }
- }
-}
diff --git a/examples/quick/demos/tweetsearch/content/ListFooter.qml b/examples/quick/demos/tweetsearch/content/ListFooter.qml
deleted file mode 100644
index b84496d4c1..0000000000
--- a/examples/quick/demos/tweetsearch/content/ListFooter.qml
+++ /dev/null
@@ -1,164 +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.0
-
-Rectangle {
- color: "#d6d6d6"
- width: parent.width
- height: childrenRect.height
- z: 2
- Connections {
- target: mainListView
- onAutoSearch: {
- if (type == 'tag') {
- tagSearch.open()
- tagSearch.searchText = str
- } else if (type == 'user'){
- userSearch.open()
- userSearch.searchText = str
- } else {
- wordSearch.open()
- wordSearch.searchText = str
- }
- }
- }
-
- Column {
- width: parent.width
-
- SearchDelegate {
- id: wordSearch
- label: "Search word..."
- placeHolder: "Enter word"
- onHasOpened: {
- tagSearch.close()
- userSearch.close()
- }
- onOk: {
- mainListView.positionViewAtBeginning()
- mainListView.clear()
- tweetsModel.from = ""
- tweetsModel.phrase = searchText
- }
- }
-
- SearchDelegate {
- id: userSearch
- label: "From user..."
- placeHolder: "@username"
- prefix: "@"
- onHasOpened:{
- tagSearch.close()
- wordSearch.close()
- }
- onOk: {
- mainListView.positionViewAtBeginning()
- mainListView.clear()
- tweetsModel.phrase = ""
- tweetsModel.from = searchText
- }
- }
-
- SearchDelegate {
- id: tagSearch
- label: "Search hashtag..."
- placeHolder: "#hashtag"
- prefix: "#"
- onHasOpened:{
- userSearch.close()
- wordSearch.close()
- }
- onOk: {
- mainListView.positionViewAtBeginning()
- mainListView.clear()
- tweetsModel.from = ""
- tweetsModel.phrase = "#" + searchText
- }
- }
-
- SpriteSequence {
- id: sprite
- anchors.horizontalCenter: parent.horizontalCenter
- width: 320
- height: 300
- running: true
- interpolate: false
- Sprite {
- name: "bird"
- source: "resources/bird-anim-sprites.png"
- frameCount: 1
- frameRate: 1
- frameWidth: 320
- frameHeight: 300
- to: { "bird":10, "trill":1, "blink":1 }
- }
- Sprite {
- name: "trill"
- source: "resources/bird-anim-sprites.png"
- frameCount: 5
- frameRate: 3
- frameWidth: 320
- frameHeight: 300
- to: {"bird":1}
- }
- Sprite {
- name: "blink"
- source: "resources/bird-anim-sprites.png"
- frameCount: 1
- frameRate: 3
- frameWidth: 320
- frameHeight: 300
- frameX: 1600
- to: {"bird":1}
- }
- }
- }
-}
diff --git a/examples/quick/demos/tweetsearch/content/ListHeader.qml b/examples/quick/demos/tweetsearch/content/ListHeader.qml
deleted file mode 100644
index 8c4facf34b..0000000000
--- a/examples/quick/demos/tweetsearch/content/ListHeader.qml
+++ /dev/null
@@ -1,91 +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.0
-
-Item {
- height: 60
- width: parent.width
-
- property bool refresh: state == "pulled" ? true : false
-
- Row {
- spacing: 6
- height: childrenRect.height
- anchors.centerIn: parent
-
- Image {
- id: arrow
- source: "resources/icon-refresh.png"
- transformOrigin: Item.Center
- Behavior on rotation { NumberAnimation { duration: 200 } }
- }
-
- Text {
- id: label
- anchors.verticalCenter: arrow.verticalCenter
- text: "Pull to refresh... "
- font.pixelSize: 18
- color: "#999999"
- }
- }
-
- states: [
- State {
- name: "base"; when: mainListView.contentY >= -120
- PropertyChanges { target: arrow; rotation: 180 }
- },
- State {
- name: "pulled"; when: mainListView.contentY < -120
- PropertyChanges { target: label; text: "Release to refresh..." }
- PropertyChanges { target: arrow; rotation: 0 }
- }
- ]
-}
diff --git a/examples/quick/demos/tweetsearch/content/SearchDelegate.qml b/examples/quick/demos/tweetsearch/content/SearchDelegate.qml
deleted file mode 100644
index 082653657a..0000000000
--- a/examples/quick/demos/tweetsearch/content/SearchDelegate.qml
+++ /dev/null
@@ -1,135 +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.0
-
-FlipBar {
- id: flipBar
- animDuration: 250
- property string label: ""
- property string placeHolder: ""
- property alias searchText: lineInput.text
- property alias prefix: lineInput.prefix
- property bool opened: false
- signal ok
- signal hasOpened
-
- height: 60
- width: parent.width
-
- function open() {
- flipBar.flipUp()
- flipBar.opened = true
- lineInput.forceActiveFocus()
- flipBar.hasOpened()
- }
-
- function close() {
- if (opened) {
- flipBar.flipDown()
- flipBar.opened = false
- }
- }
-
- front: Rectangle {
- height: 60
- width: parent.width
- color: "#999999"
-
- Rectangle { color: "#c1c1c1"; width: parent.width; height: 1 }
- Rectangle { color: "#707070"; width: parent.width; height: 1; anchors.bottom: parent.bottom }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- if (!flipBar.opened)
- open()
- else if (!lineInput.activeFocus)
- lineInput.forceActiveFocus()
- else
- close()
- }
- }
-
- Text {
- text: flipBar.label
- anchors { left: parent.left; leftMargin: 20 }
- anchors.verticalCenter: parent.verticalCenter
- font.pixelSize: 18
- color: "#ffffff"
- }
- }
-
- back: FocusScope {
- height: 60
- width: parent.width
- Rectangle {
- anchors.fill: parent
- color: "#999999"
-
- Rectangle { color: "#c1c1c1"; width: parent.width; height: 1 }
- Rectangle { color: "#707070"; width: parent.width; height: 1; anchors.bottom: parent.bottom }
-
- LineInput {
- id: lineInput
- hint: flipBar.placeHolder
- focus: flipBar.opened
- anchors { fill: parent; margins: 6 }
- onAccepted: {
- if (Qt.inputMethod.visible)
- Qt.inputMethod.hide()
- flipBar.ok()
- }
- }
- }
- }
-
-}
diff --git a/examples/quick/demos/tweetsearch/content/TweetDelegate.qml b/examples/quick/demos/tweetsearch/content/TweetDelegate.qml
deleted file mode 100644
index b8953314f1..0000000000
--- a/examples/quick/demos/tweetsearch/content/TweetDelegate.qml
+++ /dev/null
@@ -1,199 +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.0
-import "tweetsearch.js" as Helper
-
-Item {
- id: container
- property real hm: 1.0
- property int appear: -1
- property real startRotation: 1
-
- onAppearChanged: {
- container.startRotation = 0.5
- flipBar.animDuration = appear;
- delayedAnim.start();
- }
-
- SequentialAnimation {
- id: delayedAnim
- PauseAnimation { duration: 50 }
- ScriptAction { script: flipBar.flipDown(startRotation); }
- }
-
- width: 320
- height: flipBar.height * hm
-
- FlipBar {
- id: flipBar
-
- property bool flipped: false
- delta: startRotation
-
- anchors.bottom: parent.bottom
- width: container.ListView.view ? container.ListView.view.width : 0
- height: Math.max(72, tweet.y + tweet.height + 10)
-
- front: Rectangle {
- width: container.ListView.view ? container.ListView.view.width : 0
- height: Math.max(72, tweet.y + tweet.height + 10)
- color: "#2699bf"
-
- Rectangle { color: "#33ccff"; width: parent.width; height: 1 }
- Rectangle { color: "#1a6680"; width: parent.width; height: 1; anchors.bottom: parent.bottom }
-
- Image {
- id: placeHolder
- source: "resources/anonymous.png"
- x: 10; y: 9
- visible: avatar.status != Image.Ready
- }
-
- Image {
- id: avatar
- source: model.userImage
- anchors.fill: placeHolder
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- flipBar.flipUp()
- flipBar.flipped = true
- }
- }
- }
-
- Text {
- id: name
- text: model.name
- anchors { left: avatar.right; leftMargin: 10; top: avatar.top; topMargin: -3 }
- font.pixelSize: 12
- font.bold: true
- color: "white"
- linkColor: "white"
- }
-
- Text {
- id: tweet
- text: model.statusText
- anchors { left: avatar.right; leftMargin: 10; top: name.bottom; topMargin: 0; right: parent.right; rightMargin: 10 }
- wrapMode: Text.WordWrap
- font.pixelSize: 12
- font.bold: false
- color: "#adebff"
- linkColor: "white"
- onLinkActivated: {
- var tag = link.split("https://twitter.com/search?q=%23")
- var user = link.split("https://twitter.com/")
- if (tag[1] != undefined) {
- mainListView.positionViewAtBeginning()
- mainListView.clear()
- mainListView.autoSearch('tag', tag[1])
- tweetsModel.from = ""
- tweetsModel.phrase = "#" + tag[1]
- } else if (user[1] != undefined) {
- mainListView.positionViewAtBeginning()
- mainListView.clear()
- mainListView.autoSearch('user', user[1])
- tweetsModel.phrase = ""
- tweetsModel.from = user[1]
- } else
- Qt.openUrlExternally(link)
- }
- }
- }
-
- back: Rectangle {
- width: container.ListView.view ? container.ListView.view.width : 0
- height: Math.max(72, tweet.y + tweet.height + 10)
- color: "#be4a25"
-
- Rectangle { color: "#ff6633"; width: parent.width; height: 1 }
- Rectangle { color: "#80341a"; width: parent.width; height: 1; anchors.bottom: parent.bottom }
-
- Image {
- id: avatar2
- source: model.userImage
- anchors.right: parent.right
- anchors.rightMargin: 10
- y: 9
- MouseArea {
- anchors.fill: parent
- onClicked: {
- flipBar.flipDown()
- flipBar.flipped = false
- }
- }
- }
-
- Text {
- id: username
- text: model.twitterName
- x: 10; anchors { top: avatar2.top; topMargin: -3 }
- font.pixelSize: 12
- font.bold: true
- color: "white"
- linkColor: "white"
- }
-
- Text {
- text: model.source + "<br>" + Helper.formatDate(model.published) + "<br>" + model.uri
- x: 10; anchors { top: username.bottom; topMargin: 0 }
- wrapMode: Text.WordWrap
- font.pixelSize: 12
- font.bold: false
- color: "#ffc2ad"
- linkColor: "white"
- onLinkActivated: Qt.openUrlExternally(link);
- }
- }
- }
-}
diff --git a/examples/quick/demos/tweetsearch/content/TweetsModel.qml b/examples/quick/demos/tweetsearch/content/TweetsModel.qml
deleted file mode 100644
index 492f85be76..0000000000
--- a/examples/quick/demos/tweetsearch/content/TweetsModel.qml
+++ /dev/null
@@ -1,135 +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.0
-import "tweetsearch.js" as Helper
-
-Item {
- id: wrapper
-
- // Insert valid consumer key and secret tokens below
- // See https://dev.twitter.com/apps
-//! [auth tokens]
- property string consumerKey : ""
- property string consumerSecret : ""
-//! [auth tokens]
- property string bearerToken : ""
-
- property variant model: tweets
- property string from : ""
- property string phrase : ""
-
- property int status: XMLHttpRequest.UNSENT
- property bool isLoading: status === XMLHttpRequest.LOADING
- property bool wasLoading: false
- signal isLoaded
-
- ListModel { id: tweets }
-
- function encodePhrase(x) { return encodeURIComponent(x); }
-
- function reload() {
- tweets.clear()
-
- if (from == "" && phrase == "")
- return;
-
-//! [requesting]
- var req = new XMLHttpRequest;
- req.open("GET", "https://api.twitter.com/1.1/search/tweets.json?from=" + from +
- "&count=10&q=" + encodePhrase(phrase));
- req.setRequestHeader("Authorization", "Bearer " + bearerToken);
- req.onreadystatechange = function() {
- status = req.readyState;
- if (status === XMLHttpRequest.DONE) {
- var objectArray = JSON.parse(req.responseText);
- if (objectArray.errors !== undefined)
- console.log("Error fetching tweets: " + objectArray.errors[0].message)
- else {
- for (var key in objectArray.statuses) {
- var jsonObject = objectArray.statuses[key];
- tweets.append(jsonObject);
- }
- }
- if (wasLoading == true)
- wrapper.isLoaded()
- }
- wasLoading = (status === XMLHttpRequest.LOADING);
- }
- req.send();
-//! [requesting]
- }
-
- onPhraseChanged: reload();
- onFromChanged: reload();
-
- Component.onCompleted: {
- if (consumerKey === "" || consumerSecret == "") {
- bearerToken = encodeURIComponent(Helper.demoToken())
- return;
- }
-
- var authReq = new XMLHttpRequest;
- authReq.open("POST", "https://api.twitter.com/oauth2/token");
- authReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
- authReq.setRequestHeader("Authorization", "Basic " + Qt.btoa(consumerKey + ":" + consumerSecret));
- authReq.onreadystatechange = function() {
- if (authReq.readyState === XMLHttpRequest.DONE) {
- var jsonResponse = JSON.parse(authReq.responseText);
- if (jsonResponse.errors !== undefined)
- console.log("Authentication error: " + jsonResponse.errors[0].message)
- else
- bearerToken = jsonResponse.access_token;
- }
- }
- authReq.send("grant_type=client_credentials");
- }
-
-}
diff --git a/examples/quick/demos/tweetsearch/content/resources/anonymous.png b/examples/quick/demos/tweetsearch/content/resources/anonymous.png
deleted file mode 100644
index 88fba26e90..0000000000
--- a/examples/quick/demos/tweetsearch/content/resources/anonymous.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.png b/examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.png
deleted file mode 100644
index 4e8d7e6116..0000000000
--- a/examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-clear.png b/examples/quick/demos/tweetsearch/content/resources/icon-clear.png
deleted file mode 100644
index 75672f64c7..0000000000
--- a/examples/quick/demos/tweetsearch/content/resources/icon-clear.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-loading.png b/examples/quick/demos/tweetsearch/content/resources/icon-loading.png
deleted file mode 100644
index 8dbff8b70f..0000000000
--- a/examples/quick/demos/tweetsearch/content/resources/icon-loading.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-refresh.png b/examples/quick/demos/tweetsearch/content/resources/icon-refresh.png
deleted file mode 100644
index b639a638fe..0000000000
--- a/examples/quick/demos/tweetsearch/content/resources/icon-refresh.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-search.png b/examples/quick/demos/tweetsearch/content/resources/icon-search.png
deleted file mode 100644
index e41935a6c1..0000000000
--- a/examples/quick/demos/tweetsearch/content/resources/icon-search.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/content/tweetsearch.js b/examples/quick/demos/tweetsearch/content/tweetsearch.js
deleted file mode 100644
index 42a76c99fc..0000000000
--- a/examples/quick/demos/tweetsearch/content/tweetsearch.js
+++ /dev/null
@@ -1,62 +0,0 @@
-.pragma library
-
-function formatDate(date)
-{
- var da = new Date(date)
- return da.toDateString()
-}
-
-function demoToken()
-{
- var a = new Array(22).join('A')
- return a + String.fromCharCode(0x44, 0x69, 0x4a, 0x52, 0x51, 0x41, 0x41, 0x41, 0x41,
- 0x41, 0x41, 0x74, 0x2b, 0x72, 0x6a, 0x6c, 0x2b, 0x71,
- 0x6d, 0x7a, 0x30, 0x72, 0x63, 0x79, 0x2b, 0x42, 0x62,
- 0x75, 0x58, 0x42, 0x42, 0x73, 0x72, 0x55, 0x48, 0x47,
- 0x45, 0x67, 0x3d, 0x71, 0x30, 0x45, 0x4b, 0x32, 0x61,
- 0x57, 0x71, 0x51, 0x4d, 0x62, 0x31, 0x35, 0x67, 0x43,
- 0x5a, 0x4e, 0x77, 0x5a, 0x6f, 0x39, 0x79, 0x71, 0x61,
- 0x65, 0x30, 0x68, 0x70, 0x65, 0x32, 0x46, 0x44, 0x73,
- 0x53, 0x39, 0x32, 0x57, 0x41, 0x75, 0x30, 0x67)
-}
-
-function linkForEntity(entity)
-{
- return (entity.url ? entity.url :
- (entity.screen_name ? 'https://twitter.com/' + entity.screen_name :
- 'https://twitter.com/search?q=%23' + entity.text))
-}
-
-function textForEntity(entity)
-{
- return (entity.display_url ? entity.display_url :
- (entity.screen_name ? entity.screen_name : entity.text))
-}
-
-function insertLinks(text, entities)
-{
- if (typeof text !== 'string')
- return "";
-
- if (!entities)
- return text;
-
- // Add all links (urls, usernames and hashtags) to an array and sort them in
- // descending order of appearance in text
- var links = []
- if (entities.urls)
- links = entities.urls.concat(entities.hashtags, entities.user_mentions)
- else if (entities.url)
- links = entities.url.urls
-
- links.sort(function(a, b) { return b.indices[0] - a.indices[0] })
-
- for (var i = 0; i < links.length; i++) {
- var offset = links[i].url ? 0 : 1
- text = text.substring(0, links[i].indices[0] + offset) +
- '<a href=\"' + linkForEntity(links[i]) + '\">' +
- textForEntity(links[i]) + '</a>' +
- text.substring(links[i].indices[1])
- }
- return text.replace(/\n/g, '<br>');
-}