diff options
author | Liang Qi <liang.qi@qt.io> | 2016-12-14 19:01:23 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-12-14 19:01:23 +0100 |
commit | 0e80d28aa5892d6bbb4d0017b1bc9a33489f4176 (patch) | |
tree | 0db2e10c8776d172bccaeaa7ee1fab3934b93073 /examples/quick/demos/stocqt/stocqt.qml | |
parent | ed32558d6280cae40578f735fd326327d571d993 (diff) | |
parent | 16c81bb0d493af00bc376784bcb7e03a4a037b04 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
src/qml/qml/qqmlimport.cpp
src/quick/items/context2d/qquickcontext2dtexture_p.h
tools/qmleasing/splineeditor.h
Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
Diffstat (limited to 'examples/quick/demos/stocqt/stocqt.qml')
-rw-r--r-- | examples/quick/demos/stocqt/stocqt.qml | 115 |
1 files changed, 38 insertions, 77 deletions
diff --git a/examples/quick/demos/stocqt/stocqt.qml b/examples/quick/demos/stocqt/stocqt.qml index 6b1da1713a..a13e63fd50 100644 --- a/examples/quick/demos/stocqt/stocqt.qml +++ b/examples/quick/demos/stocqt/stocqt.qml @@ -40,6 +40,7 @@ import QtQuick 2.0 import QtQml.Models 2.1 +import QtQuick.Layouts 1.1 import "./content" Rectangle { @@ -49,90 +50,50 @@ Rectangle { property alias currentIndex: root.currentIndex - Rectangle { - id: banner - height: 80 - anchors.top: parent.top - width: parent.width - color: "#000000" + ColumnLayout { + anchors.fill: parent - Image { - id: arrow - source: "./content/images/icon-left-arrow.png" - anchors.left: banner.left - anchors.leftMargin: 20 - anchors.verticalCenter: banner.verticalCenter - visible: root.currentIndex == 1 ? true : false - - MouseArea { - anchors.fill: parent - onClicked: root.currentIndex = 0; - } - } - - Item { - id: textItem - width: stocText.width + qtText.width - height: stocText.height + qtText.height - anchors.horizontalCenter: banner.horizontalCenter - anchors.verticalCenter: banner.verticalCenter - - Text { - id: stocText - anchors.verticalCenter: textItem.verticalCenter - color: "#ffffff" - font.family: "Abel" - font.pointSize: 40 - text: "Stoc" - } - Text { - id: qtText - anchors.verticalCenter: textItem.verticalCenter - anchors.left: stocText.right - color: "#5caa15" - font.family: "Abel" - font.pointSize: 40 - text: "Qt" - } + Banner { + id: banner + Layout.fillWidth: true } - } - ListView { - id: root - width: parent.width - anchors.top: banner.bottom - anchors.bottom: parent.bottom - snapMode: ListView.SnapOneItem - highlightRangeMode: ListView.StrictlyEnforceRange - highlightMoveDuration: 250 - focus: false - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds + ListView { + id: root + Layout.fillHeight: true + Layout.fillWidth: true + snapMode: ListView.SnapOneItem + highlightRangeMode: ListView.StrictlyEnforceRange + highlightMoveDuration: 250 + focus: false + orientation: ListView.Horizontal + boundsBehavior: Flickable.StopAtBounds - StockModel { - id: stock - stockId: listView.currentStockId - stockName: listView.currentStockName - onStockIdChanged: stock.updateStock(); - onDataReady: { - root.currentIndex = 1 - stockView.update() + StockModel { + id: stock + stockId: listView.currentStockId + stockName: listView.currentStockName + onStockIdChanged: stock.updateStock(); + onDataReady: { + root.currentIndex = 1 + stockView.update() + } } - } - model: ObjectModel { - StockListView { - id: listView - width: root.width - height: root.height - } + model: ObjectModel { + StockListView { + id: listView + width: root.width + height: root.height + } - StockView { - id: stockView - width: root.width - height: root.height - stocklist: listView - stock: stock + StockView { + id: stockView + width: root.width + height: root.height + stocklist: listView + stock: stock + } } } } |