summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2016-04-18 18:05:52 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2016-04-18 16:14:42 +0000
commita5a02e74ff3d150f8ad9f28a01f74e42dc0f025b (patch)
tree8d62871a192b3042dd86bcf5f8d892c559d70776
parent2a0463a00627225b79e64504d99838b751921650 (diff)
downloadqtquickcontrols-a5a02e74ff3d150f8ad9f28a01f74e42dc0f025b.tar.gz
Improve DialStyle's valueToAngle() tests and documentation
The minimumValueAngle and maximumValueAngle variables it mentions are private. Change-Id: Ib95c96aeb218c8624857c212429f6c4e4e77ece2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r--src/controls/Styles/Base/DialStyle.qml4
-rw-r--r--tests/auto/extras/data/tst_dial.qml10
2 files changed, 10 insertions, 4 deletions
diff --git a/src/controls/Styles/Base/DialStyle.qml b/src/controls/Styles/Base/DialStyle.qml
index 6c9a68d3..8287dc1f 100644
--- a/src/controls/Styles/Base/DialStyle.qml
+++ b/src/controls/Styles/Base/DialStyle.qml
@@ -151,10 +151,6 @@ Style {
the style's components. For example, it can be used to calculate the
angles at which to draw an arc around the dial indicating the safe
range of values.
-
- For example, if minimumValueAngle is set to \c 270 and
- maximumValueAngle is set to \c 90, this function will return \c 270
- when passed minimumValue and \c 90 when passed maximumValue.
*/
function valueToAngle(value) {
return control.__panel.circularTickmarkLabel.valueToAngle(value);
diff --git a/tests/auto/extras/data/tst_dial.qml b/tests/auto/extras/data/tst_dial.qml
index 2b1d92cd..f94b5245 100644
--- a/tests/auto/extras/data/tst_dial.qml
+++ b/tests/auto/extras/data/tst_dial.qml
@@ -368,4 +368,14 @@ TestCase {
dial.destroy();
}
+
+ function test_valueToAngle() {
+ var dial = Qt.createQmlObject("import QtQuick.Extras 1.4; Dial { }", testcase, "");
+ verify(dial, "Dial: failed to create an instance");
+
+ compare(dial.__style.valueToAngle(0.0), dial.__panel.circularTickmarkLabel.minimumValueAngle);
+ compare(dial.__style.valueToAngle(1.0), dial.__panel.circularTickmarkLabel.maximumValueAngle);
+
+ dial.destroy();
+ }
}