Search code examples
setqmlclickable

Unable to set "SetClickable" tag


How can I disable Mouse Clicks in certain MouseAreas?

I am using the some code inside MouseArea{ .... } and want them to be disabled till the time a flag for them doesn't turn TRUE!

onClicked: {
                focus: true
                onClicked: pageLoader.source = "PAGE3.qml";
           }

There are multiple mouseAreas in the program. What is needed is to disable all other MouseAreas when one MouseArea has already been clicked and the page corresponding to that mouseArea is loaded using loader .
These mouseAreas are loaded as a matrix using the Grid function of QML.

How can I do that?


Solution

  • Got the answer! You need to add
    enable: false

    Example:
    Grid {
    enable: true }

    This will enable the Grid and;

    Grid {
    enable: false }

    This will disable the Grid!