forked from qt-creator/qt-creator
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 <ulf.hermann@qt.io>
This commit is contained in:
@@ -259,19 +259,21 @@ Rectangle {
|
|||||||
hoverEnabled: enabled
|
hoverEnabled: enabled
|
||||||
z: 2
|
z: 2
|
||||||
|
|
||||||
onReleased: {
|
function handlePress() {
|
||||||
if (selectionRange.creationState === selectionRange.creationSecondLimit) {
|
|
||||||
content.interactive = true;
|
|
||||||
selectionRange.creationState = selectionRange.creationFinished;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onPressed: {
|
|
||||||
if (selectionRange.creationState === selectionRange.creationFirstLimit) {
|
if (selectionRange.creationState === selectionRange.creationFirstLimit) {
|
||||||
content.interactive = false;
|
content.interactive = false;
|
||||||
selectionRange.setPos(selectionRangeControl.mouseX + content.contentX);
|
selectionRange.setPos(selectionRangeControl.mouseX + content.contentX);
|
||||||
selectionRange.creationState = selectionRange.creationSecondLimit;
|
selectionRange.creationState = selectionRange.creationSecondLimit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onReleased: {
|
||||||
|
if (selectionRange.creationState === selectionRange.creationSecondLimit) {
|
||||||
|
content.interactive = true;
|
||||||
|
selectionRange.creationState = selectionRange.creationFinished;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onPressed: handlePress()
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
if (selectionRange.creationState === selectionRange.creationInactive)
|
if (selectionRange.creationState === selectionRange.creationInactive)
|
||||||
selectionRange.creationState = selectionRange.creationFirstLimit;
|
selectionRange.creationState = selectionRange.creationFirstLimit;
|
||||||
@@ -280,7 +282,7 @@ Rectangle {
|
|||||||
selectionRange.creationState !== selectionRange.creationFinished)
|
selectionRange.creationState !== selectionRange.creationFinished)
|
||||||
selectionRange.setPos(selectionRangeControl.mouseX + content.contentX);
|
selectionRange.setPos(selectionRangeControl.mouseX + content.contentX);
|
||||||
}
|
}
|
||||||
onCanceled: pressed()
|
onCanceled: handlePress()
|
||||||
}
|
}
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
|
Reference in New Issue
Block a user