able to touch on disabled background when popup is up.
-
hi all,
in our project when a popup displayed on screen we disable background which doesn't receive any touch/mouse click events.
but when i press mouse and touch same time very fast, many times in disabled background, suddenly it receives mouse and touch events.
please let me know why this is happening.
thanks ,
ayyappa. -
@AYYAPPA said in able to touch on disabled background when popup is up.:
please let me know why this is happening.
from whom do you expect an answer here?!
Your post barely gives more information than "i have a problem". -
@raven-worx i am sorry about that, i couldn't attach project work here. now i created on paint image with description . hope this helps.
-
@AYYAPPA can you help with simple example which shows the behaviour. You can create simple project with three objects like the above. This helps us to check & revert. Please note that issue could be from QML or your project logic. To identify the issue, simple workable code with your issue will help.
-
Rectangle {
id: mainWindowwidth: 1920 height: 1080
enabled: !(dialogue1.visible || dialogue2.visible)
MouseArea{
id: m1enabled: parent.enabled anchors{ left: parent.left right: parent.verticalCenter top: parent.top bottom: parent.bottom } //display function displays dialogue in center and disables background //dialogue 1 dimensions 1000x700 onClicked: display(dialogue1) } MouseArea{ id: m2 enabled: parent.enabled anchors{ left: parent.verticalCenter right: parent.right top: parent.top bottom: parent.bottom } //display function displays dialogue in center and disables background //dialogue 1 dimensions 1000x700 onClicked: display(dialogue2) }
}
in above code when we click left half of mainWindow dialogue 1 is displayed, or if we click right half of mainWindow dialogue 2 is displayed.
now open any one dialogue, as its dimesnions are almost half of mainWindow, we see can see some part of mainWindow around displayed dialogue. in code we disable maninWindow if any dialogue is on screen, and mouse areas m1 and m2 enabled related to mainWindow enabled , they will also be disabled. so clicking in seen portion of mainWIndow when any dialogue is on screen will not display any dialogue as mouse areas are disabled. . now if we click with mouse and touch with finger simultaneously and repeatedly in disabled m1 or m2 , after some time they will receive the click event and respective dialogue will be displayed. -
i was able to resolve issue, with the use of multipointtoucharea treating mouse click as single touch event and setting minimum and maximum touch points to zero to discard all mouse and touch events in disabled background.
i used this piece of code in place of mouse area:
MultiPointTouchArea{
id: clickCatcher
anchors.fill: parent
mouseEnabled: true
minimumTouchPoints: 1
maximumTouchPoints: 1
}