diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-10-04 14:34:03 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-10-04 15:53:33 +0200 |
commit | 8fc3c036debf8e230200e1c7d2a8e65df140ca76 (patch) | |
tree | e79f15e509d9b20bdfc804285c4253026e2929dd /tests/manual | |
parent | 2c99a8db69e40620d91d7415b02a8e222f2a2c59 (diff) |
Flickable manual test: add sliders to adjust flick-speed metrics
The sliders adjust maximumFlickVelocity and flickDeceleration.
Also in the shared Slider: try harder to end up with value being
the same as init, after initialization, by making the range of movement
divisible by more numbers, by default. 180 is highly divisible, and
keeps the default Slider size reasonable. You can still override the
size of the Slider arbitrarily, though.
Task-number: QTBUG-97055
Change-Id: I6fb41ccb87e401a747d5a8add3100053a06d9d88
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/touch/flicktext.qml | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/manual/touch/flicktext.qml b/tests/manual/touch/flicktext.qml index e69d6207a9..72128fe33c 100644 --- a/tests/manual/touch/flicktext.qml +++ b/tests/manual/touch/flicktext.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the manual tests of the Qt Toolkit. @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick import "qrc:/quick/shared/" as Examples Rectangle { @@ -75,6 +75,8 @@ Rectangle { } onContentXChanged: canvas.requestPaint() onContentYChanged: canvas.requestPaint() + maximumFlickVelocity: maxVelocitySlider.value + flickDeceleration: decelSlider.value } Timer { id: fadeTimer; interval: 1000; onTriggered: { hfade.start(); } } @@ -204,6 +206,7 @@ Rectangle { id: bottomFlow anchors.bottom: parent.bottom width: parent.width - 12 + height: 110 x: 6 spacing: 12 @@ -301,6 +304,33 @@ Rectangle { color: "white" text: "v " + flick.verticalVelocity.toFixed(2) } + Examples.Slider { + id: maxVelocitySlider + name: "max vel" + anchors.left: parent.left + anchors.top: parent.bottom + max: 10000 + init: 2500 + } + Text { + anchors.left: maxVelocitySlider.right + anchors.verticalCenter: maxVelocitySlider.verticalCenter + text: Math.round(flick.maximumFlickVelocity) + } + Examples.Slider { + id: decelSlider + name: "decel" + anchors.right: maxVelocitySlider.right + anchors.top: maxVelocitySlider.bottom + min: 0 + max: 10000 + init: 1500 + } + Text { + anchors.left: decelSlider.right + anchors.verticalCenter: decelSlider.verticalCenter + text: Math.round(flick.flickDeceleration) + } } } |