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

QML MenuItem disappear after highlighting using Instantiator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.12.0 Beta 1
    • Fix Version/s: 5.12.0 RC
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Platform/s:
      macOS
    • Commits:
      953fbac6131823e4fce0eb4707a854469c4c04ff (qt/qtquickcontrols2/5.12.0)
    • Sprint:
      Triaged issues

      Description

      In my application I dynamically populate a Menu using QMLs Instantiator. This works fine with Qt 5.11.2, but is not with 5.12.0 beta1 (only tested on macOS Mojave).

      Initial all MenuItem's are visible, but as soon as I hover these they disappear.

       

      This code works as expected with qmlscene from 5.11 and is broken using qmlscene from 5.12:

      import QtQml 2.11
      import QtQuick 2.11
      import QtQuick.Controls 2.4
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
      
          menuBar: MenuBar {
              Menu {
                  title: qsTr("&Ok")
                  MenuItem { text: "A" }
                  MenuItem { text: "B" }
                  MenuItem { text: "C" }
              }
      
              Menu {
                  id: moduleMenu
                  title: qsTr("&Broken")
      
                  Instantiator {
                      model: ["A", "B", "C"]
      
                      MenuItem { text: modelData }
      
                      onObjectAdded: moduleMenu.insertItem(index, object)
                      onObjectRemoved: moduleMenu.removeItem(object)
                  }
              }
          }
      }
      

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                mitch_curtis Mitch Curtis
                Reporter:
                hilefoks Stefan Böhmann
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes