aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/cursorChange
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-02-22 13:27:33 +0100
committerAndy Shaw <andy.shaw@qt.io>2019-02-25 07:25:18 +0000
commite622e069c9b0928e09a8b6fef15168407a4d995a (patch)
tree2a008f2eaee3e3cf6359641f31197c5d294f2c49 /tests/manual/cursorChange
parent3ad752e1c16a3d37a71c5a7527c7e67cc333cdd2 (diff)
Update the cursor when the window is entered
When a window is entered, due to another window being hidden, then it is possible that the item under the mouse has a different cursor than the one previously set for that window. Since there will not be a mouse move at this point yet, then we should update the cursor right away. Change-Id: I2ef3c72617ae5c995a4daf7daef1ba3311fdcc12 Fixes: QTBUG-41045 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/manual/cursorChange')
-rw-r--r--tests/manual/cursorChange/main.qml79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/manual/cursorChange/main.qml b/tests/manual/cursorChange/main.qml
new file mode 100644
index 0000000000..563545b60d
--- /dev/null
+++ b/tests/manual/cursorChange/main.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.0
+
+Window {
+ id: tw
+ visible: true
+ width: 800
+ height: 500
+ color: "green"
+ Text {
+ id: txt
+ font.pointSize: 16
+ anchors.top: parent.top
+ text: "Move to the blue item.\nCheck the mouse cursor is a PointingHand.\nClick on the blue item."
+ }
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 100
+ height: 50
+ color: "blue"
+ MouseArea {
+ id: testHand
+ anchors.fill: parent
+ onClicked: {
+ tw1.show()
+ }
+ cursorShape: Qt.PointingHandCursor
+ }
+ }
+
+ Window {
+ Text {
+ font.pointSize: 16
+ anchors.top: parent.top
+ text: "Move the cursor to near one of the edges.\nClick the mouse button."
+ }
+ id: tw1
+ visible: false
+ width: 800
+ height: 500
+ color: "yellow"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ tw1.close()
+ txt.text = "Mouse cursor should now be back to an Arrow cursor"
+ }
+ }
+ }
+}