From 05d34a7e1ad1dab73669d4a5211aa29ed57a12bc Mon Sep 17 00:00:00 2001 From: Maximilian Goldstein Date: Wed, 23 Feb 2022 11:56:56 +0100 Subject: [PATCH] tracing/MainView: Fix broken MouseArea signal handler onCancelled tries to trigger the signal pressed() which is shadowed by the property of the same name. Properly handled this by moving the onPressed handler into its own function. Change-Id: I8ed966e256acdd8dc76d9ee5b244682217323a0d Reviewed-by: Ulf Hermann --- src/libs/tracing/qml/MainView.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/libs/tracing/qml/MainView.qml b/src/libs/tracing/qml/MainView.qml index 5de435ef12d..c00112dee64 100644 --- a/src/libs/tracing/qml/MainView.qml +++ b/src/libs/tracing/qml/MainView.qml @@ -259,19 +259,21 @@ Rectangle { hoverEnabled: enabled z: 2 - onReleased: { - if (selectionRange.creationState === selectionRange.creationSecondLimit) { - content.interactive = true; - selectionRange.creationState = selectionRange.creationFinished; - } - } - onPressed: { + function handlePress() { if (selectionRange.creationState === selectionRange.creationFirstLimit) { content.interactive = false; selectionRange.setPos(selectionRangeControl.mouseX + content.contentX); selectionRange.creationState = selectionRange.creationSecondLimit; } } + + onReleased: { + if (selectionRange.creationState === selectionRange.creationSecondLimit) { + content.interactive = true; + selectionRange.creationState = selectionRange.creationFinished; + } + } + onPressed: handlePress() onPositionChanged: { if (selectionRange.creationState === selectionRange.creationInactive) selectionRange.creationState = selectionRange.creationFirstLimit; @@ -280,7 +282,7 @@ Rectangle { selectionRange.creationState !== selectionRange.creationFinished) selectionRange.setPos(selectionRangeControl.mouseX + content.contentX); } - onCanceled: pressed() + onCanceled: handlePress() } Flickable {