Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Arbitrary positioning QML popup menu

Arbitrary positioning QML popup menu

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 1 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _dmp
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _dmp
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • _ Offline
        _ Offline
        _dmp
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved