aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/canvas/tiger
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2021-02-04 11:46:07 +0100
committerOliver Eftevaag <oliver.eftevaag@qt.io>2021-03-10 17:53:22 +0100
commit1d3cdac6e448479127d3077c6e011d75fa77e6d6 (patch)
tree15d60db3bb5116159ab795aac0765bde07c60138 /examples/quick/canvas/tiger
parentea8f8e09007f4acb5530b1966bc5b2afab609064 (diff)
Update canvas example to use QtQuickControls2
The QtQuick examples should ideally have a more native look and feel. Making them use controls from QtQuickControl will cause them to adapt to the desktop style. This patch replaces the previous Sliders from the 'shared' directory, with Sliders from QtQuickControls2 Task-number: QTBUG-90880 Change-Id: I90521abf7059950521bc3d1a54994d2cca07259d Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'examples/quick/canvas/tiger')
-rw-r--r--examples/quick/canvas/tiger/tiger.qml15
1 files changed, 8 insertions, 7 deletions
diff --git a/examples/quick/canvas/tiger/tiger.qml b/examples/quick/canvas/tiger/tiger.qml
index 71367d560a..abd823d40e 100644
--- a/examples/quick/canvas/tiger/tiger.qml
+++ b/examples/quick/canvas/tiger/tiger.qml
@@ -48,9 +48,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import "../contents"
-import "../../shared"
+import QtQuick
+import QtQuick.Controls
+import "../"
import "tiger.js" as Tiger
Item {
@@ -63,7 +63,7 @@ Item {
anchors.fill: parent
anchors.topMargin: 12
- Text {
+ Label {
font.pointSize: 24
font.bold: true
text: "Tiger with SVG path"
@@ -137,8 +137,9 @@ Item {
id: controls
anchors.bottom: parent.bottom
anchors.bottomMargin: 12
- Slider {id: scaleCtrl ; min: 0.1 ; max: 1 ; init: 0.3 ; name: "Scale"}
- Slider {id: rotateCtrl ; min: 0 ; max: Math.PI*2 ; init: 0 ; name: "Rotate"}
- Slider {id: alphaCtrl ; min: 0 ; max: 1 ; init: 1 ; name: "Alpha"}
+
+ LabeledSlider {id: scaleCtrl ; min: 0.1 ; max: 1 ; init: 0.3 ; name: "Scale"; width: container.width}
+ LabeledSlider {id: rotateCtrl ; min: 0 ; max: Math.PI*2 ; init: 0 ; name: "Rotate"; width: container.width}
+ LabeledSlider {id: alphaCtrl ; min: 0 ; max: 1 ; init: 1 ; name: "Alpha"; width: container.width}
}
}