From 2430cc139437dac021b6028d8ba8799c50bd0e6c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 10 Oct 2017 10:29:50 +0200 Subject: Update slider handle position when maximum changes This is exactly the same as the minimum change, when the maximum is changed, the handle position needs to be re-evaluated. Task-number: QTBUG-63354 Change-Id: I13a67451190a3bb7915afe8e89501097c1dd3301 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_slider.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/auto/controls/data') diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index 0eec7e34..34627daa 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -392,7 +392,7 @@ Item { } } - function test_minimumValueLargerThanValue() { + function test_minimumMaximumValueLargerThanValue() { var control = sliderComponent.createObject(container, { "style": namedHandleStyle, "minimumValue": 0, "maximumValue": 2, value: "minimumValue" }); verify(control); @@ -405,6 +405,19 @@ Item { compare(control.value, control.minimumValue); compare(handle.mapToItem(null, 0, 0).x, 0) + control.maximumValue = 5; + control.value = 5; + compare(control.value, 5); + + // get the slider position at max + var maxPos = handle.mapToItem(null, 0, 0).x; + + // reduce the maximum value, resulting in the value becoming 4 as well + control.maximumValue = 4; + compare(control.value, 4); + // make sure that the actual position of the handle is the same (it used to be off - see QTBUG-63354) + compare(handle.mapToItem(null, 0, 0).x, maxPos); + control.destroy(); } } -- cgit v1.2.1 From 296810ea4bb4f734881a517eb101e5b948c1905b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 28 Sep 2017 16:38:30 +0200 Subject: Fix outdated FDL license header Change-Id: I03c222a72490959d55b3077a6282553a4bfcf7d2 Reviewed-by: Jani Heikkinen --- tests/auto/controls/data/rangemodel/init.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tests/auto/controls/data') diff --git a/tests/auto/controls/data/rangemodel/init.qml b/tests/auto/controls/data/rangemodel/init.qml index 9d050143..12395276 100644 --- a/tests/auto/controls/data/rangemodel/init.qml +++ b/tests/auto/controls/data/rangemodel/init.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are -- cgit v1.2.1