From 7dfe54c9808ed3057fa2f42b684a8b28a1bd22ce Mon Sep 17 00:00:00 2001 From: Adriano Rezende <adriano.1.rezende@nokia.com> Date: Wed, 4 Jul 2012 17:02:14 +0200 Subject: [PATCH] Fix Splitters to use new API Change-Id: I7ce96151cfb57c46f5132e70530c2ec339ff59ae Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@nokia.com> --- components/SplitterColumn.qml | 7 ++----- components/SplitterRow.qml | 6 +----- tests/manual/splitter.qml | 36 +++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 tests/manual/splitter.qml diff --git a/components/SplitterColumn.qml b/components/SplitterColumn.qml index 4f64868b5..8b1d56b5b 100644 --- a/components/SplitterColumn.qml +++ b/components/SplitterColumn.qml @@ -153,12 +153,9 @@ Private.Splitter { anchors.fill: parent anchors.topMargin: (parent.height <= 1) ? -2 : 0 anchors.bottomMargin: (parent.height <= 1) ? -2 : 0 - drag.axis: Qt.XandYAxis // Why doesn't X-axis work? + drag.axis: Drag.XandYAxis // Why doesn't X-axis work? drag.target: handle - CursorArea { - anchors.fill: parent - cursor: CursorArea.SplitVCursor - } + cursorShape: Qt.SplitVCursor } } } diff --git a/components/SplitterRow.qml b/components/SplitterRow.qml index c1466c61e..e8be6acc4 100644 --- a/components/SplitterRow.qml +++ b/components/SplitterRow.qml @@ -155,11 +155,7 @@ Private.Splitter { anchors.rightMargin: (parent.width <= 1) ? -2 : 0 drag.axis: Qt.YAxis drag.target: handle - - CursorArea { - anchors.fill: parent - cursor: CursorArea.SplitHCursor - } + cursorShape: Qt.SplitHCursor } } } diff --git a/tests/manual/splitter.qml b/tests/manual/splitter.qml new file mode 100644 index 000000000..0747eed90 --- /dev/null +++ b/tests/manual/splitter.qml @@ -0,0 +1,36 @@ +import QtQuick 2.0 +import QtDesktop 0.2 + +ApplicationWindow { + width: 400 + height: 200 + + Row { + SplitterColumn { + width: 200 + height: 200 + + Button { + text: "Button 1" + } + Button { + text: "Button 2" + } + Button { + text: "Button 2" + } + } + + SplitterRow { + width: 200 + height: 200 + + Button { + text: "Button 1" + } + Button { + text: "Button 2" + } + } + } +} -- GitLab