Two MouseAreas for the same real estate?
-
Do I have a limitation with two MouseAreas being defined for the same space. I have two separate qml documents, a navigation bar being loaded onto a main screen. I want mouseareas in the navigation.qml file to perform color changes and other state changes. I want the mouseareas in the main.qml page to handle navigation when a user clicks on the buttons.
It seems that only one will work. Is this true?
-
If they are not overlapping then both should work.
-
They are not overlapping in the same qml files but when they are loaded it would be overlapping.
-
if they will overlap each other then of course only one (with greater z-order) will work.
-
Hi,
By default, the first item to accept a mouse press "grabs" the mouse (for more on this behavior, see docs "here":http://doc.qt.nokia.com/4.7/qgraphicsitem.html#mousePressEvent). So currently only one MouseArea can actively handle mouse events. We'd like to make this more flexible -- the task tracking this is "QTBUG-13007":http://bugreports.qt.nokia.com/browse/QTBUG-13007
Regards,
Michael