Arbitrary positioning QML popup menu

  • I want show QML popup Menu as anchors.cenerIn: parent.
    Now popup menu showed at mouse coordinates.
    Is there a way to display the menu in the center of the screen?
    I use Qt5.3

  • ok. I found undocumented Q_INVOKABLE method of Menu __popup(qreal x, qreal y, int atActionIndex = -1)

    may be it an method will removed in future(please do not remove it!)

    but when I got geometry of menu window by Menu.__popupGeometry.height and Menu.__popupGeometry.width
    I got by Menu.__popupGeometry.width real width of menu window, but Menu.__popupGeometry.height gave value 2 permanently.

    As well. If I click on the menu having a child menu - the menu is closed. Although this menu should not be closed if it has no action.

  • In general, the Menu seems unreasonable and closed, with no prospect of enlargement. Impossible to know the geometry of the menu window before it opens. I am disappointed implementation of Menu.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.