Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96430

Qml Menu items are outside of app window

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.2
    • Quick: Controls 2
    • None
    • All

      Steps to reproduce:

      1. Make sure that the menu is larger than the app window so that the menu must be scrolled .
      2. Press the "Test" button. All menu items are accessible.
      3. Press the "Test" button again. The item(s) on the top are not accessible anymore because they stay outside of the app window.
      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.12
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          ToolButton {
              id: btn
              text: "Test"
              anchors.centerIn: parent
      
              onClicked: {
                  contextMenu.x = btn.x;
                  contextMenu.y = btn.y;
                  contextMenu.open();
              }
          }
      
      
          Menu {
              id: contextMenu
      
              Repeater {
                  model: 20
                  MenuItem { text: "Item " + index }
              }
          }
      }
      
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            DanielSt Peter Staab
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes