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

Android - Menu crashes on takeAction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • None
    • 6.2.2
    • Quick: Controls 2
    • Android 11.0
      Android NDK 21.3.6528147 (Qt 5.15.2)
      Android NDK 22.1.7171670 (Qt 6.2.2)
      Windows 10 21H2 (19043.1415) (Qt 6.2.2 MinGW)

    Description

      Not sure if what I do is evil ... but it used to work in the past. (At least Qt 5.15.2)

      I use something similar in an app to dynamically add/remove Actions to a Menu.

      Example:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      ApplicationWindow {
          width: 640
          height: 480
          visible: true
          title: qsTr("MenuCrash")
          Menu{
              id: contextMenu
              height: parent.height
              width: parent.width
      
              Action{ text: "Action 0" }
              Action{ text: "Action 1" }
              Action{ text: "Action 2" }
      
              Action{
                  id: closeAction
                  text: "Close (3)"
                  onTriggered: contextMenu.close()
              }
      
              function show(){
                  takeAction( 3 );
                  addAction( closeAction );
                  open();
              }
          }
          Button{
              text: "Open menu"
              onClicked: contextMenu.show()
              anchors.centerIn: parent
          }
      }
      

      How to reproduce:

      1. Open the app on android
      2. Tap "Open Menu" -> Menu opens
      3. Tap "Close (3)" -> Menu closes
      4. Tap "Open Menu" -> App crashes

      Works on Windows.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Marscho Marscho
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes