Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to use the ActionSelectionPopover located here, I can't find any examples on how to actually execute/show it, from looking at the demo QML files this is what I have come up with:

/* Popup menu when right clicking items */
ActionSelectionPopover {
    id: contextMenu
    actions: ActionList {
        Action {
            text: i18n.tr("View Item Info")
            onTriggered: print(text)
        }
    }
}

Then later I have this in an item:

onClicked: {
    contextMenu.caller = item;
    contextMenu.show();
    print(item);
}

Now the item is printed, but the ActionSelectionPopover does not show.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Well I figured out what was going on in my case, I was handling it correctly, what was happening is for some reason, probably because where my ActionSelectionPopover was located in my QML file, it was appearing below all the other components in my app, I just set it's z property to 100, and now it works fine, so this is my new ActionSelectionPopover code:

/* Popup menu when right clicking items */
ActionSelectionPopover {
    id: contextMenu
    z: 100
    actions: ActionList {
        Action {
            text: i18n.tr("View Item Info")
            onTriggered: print(text)
        }
    }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.