Fix mouse handling issue in modal popup
The modal popup block input for the condition as specified in the
patchset 3326439361
. But this blocks input
to the popup itself via ancestor validation.
This patchset fix the issue by avoiding ancestor validation if its same
item.
Fixes: QTBUG-113853
Pick-to: 6.3 6.4 6.5
Change-Id: Icb3c04861396883c2969374fc5f7b8beb76ccdb9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
parent
30c1911ed2
commit
dc30e3859f
|
@ -371,7 +371,7 @@ bool QQuickPopupPrivate::blockInput(QQuickItem *item, const QPointF &point) cons
|
||||||
// a) outside a non-modal popup,
|
// a) outside a non-modal popup,
|
||||||
// b) to popup children/content, or
|
// b) to popup children/content, or
|
||||||
// b) outside a modal popups's background dimming
|
// b) outside a modal popups's background dimming
|
||||||
return modal && !popupItem->isAncestorOf(item) && (!dimmer || dimmer->contains(dimmer->mapFromScene(point)));
|
return modal && ((popupItem != item) && !popupItem->isAncestorOf(item)) && (!dimmer || dimmer->contains(dimmer->mapFromScene(point)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQuickPopupPrivate::handlePress(QQuickItem *item, const QPointF &point, ulong timestamp)
|
bool QQuickPopupPrivate::handlePress(QQuickItem *item, const QPointF &point, ulong timestamp)
|
||||||
|
|
|
@ -1449,6 +1449,18 @@ TestCase {
|
||||||
mouseRelease(title, pressPoint.x, pressPoint.y)
|
mouseRelease(title, pressPoint.x, pressPoint.y)
|
||||||
compare(title.pressedPosition, Qt.point(0, 0))
|
compare(title.pressedPosition, Qt.point(0, 0))
|
||||||
|
|
||||||
|
|
||||||
|
// Set modal as true and check for the same operation
|
||||||
|
popup.modal = true
|
||||||
|
oldPos = Qt.point(popup.x, popup.y)
|
||||||
|
mousePress(title, pressPoint.x, pressPoint.y)
|
||||||
|
fuzzyCompare(title.pressedPosition.x, pressPoint.x, 1)
|
||||||
|
fuzzyCompare(title.pressedPosition.y, pressPoint.y, 1)
|
||||||
|
mouseMove(title, pressPoint.x + 5, pressPoint.y + 5)
|
||||||
|
fuzzyCompare(popup.x, oldPos.x + 5, 1)
|
||||||
|
fuzzyCompare(popup.y, oldPos.y + 5, 1)
|
||||||
|
mouseRelease(title, pressPoint.x, pressPoint.y)
|
||||||
|
compare(title.pressedPosition, Qt.point(0, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|
Loading…
Reference in New Issue