From efcb9746e8f4c7917017b3d9f109a80dc5069557 Mon Sep 17 00:00:00 2001 From: lordwelch Date: Mon, 7 Mar 2016 21:40:07 -0800 Subject: [PATCH] add a scrollview --- main.qml | 72 ++++++++++++++++++++++++++++------------------------- qml/img.qml | 6 ++--- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/main.qml b/main.qml index c110d57..5aab3b4 100644 --- a/main.qml +++ b/main.qml @@ -75,46 +75,50 @@ ApplicationWindow { anchors.top: parent.top anchors.topMargin: 0 - SplitView { - id: gridData - objectName: "gridData" - anchors.rightMargin: 4 - anchors.leftMargin: 4 - anchors.bottomMargin: 4 - anchors.topMargin: 4 + ScrollView { + id: scview anchors.fill: parent + anchors.margins: 4 - Rectangle { - id: col1 - objectName: "col1" - width: gridData.width / 2 - color: "#e41616" - transformOrigin: Item.TopLeft - border.width: 0 + SplitView { + id: gridData + objectName: "gridData" + width: scview.width + height: 100 - ColumnLayout { - id: data1 - objectName: "data1" - spacing: 1 - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.top: parent.top - anchors.left: parent.left + Rectangle { + id: col1 + objectName: "col1" + width: gridData.width / 2 + color: "#e41616" + transformOrigin: Item.TopLeft + border.width: 0 + + Column { + id: data1 + objectName: "data1" + spacing: 1 + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.top: parent.top + anchors.left: parent.left + + + } } - } - Rectangle { - id: col2 - objectName: "col2" - color: "#4f90e2" - border.width: 0 - - ColumnLayout { - id: data2 - spacing: 1 - objectName: "data2" - anchors.fill: parent + Rectangle { + id: col2 + objectName: "col2" + color: "#4f90e2" + border.width: 0 + Column { + id: data2 + spacing: 1 + objectName: "data2" + anchors.fill: parent + } } } } diff --git a/qml/img.qml b/qml/img.qml index e1a6bdc..1a5d998 100644 --- a/qml/img.qml +++ b/qml/img.qml @@ -6,11 +6,11 @@ Image { source: "image://images/" objectName: "cellImg" property int index: 0 - height: 150 + height: 100 transformOrigin: Item.TopLeft fillMode: Image.PreserveAspectFit anchors.right: parent.right anchors.left: parent.left - Layout.minimumHeight: 100 - Layout.maximumHeight: 200 + + }