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

MenuItem is not hidden when visible=false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.9.0 Beta 2
    • Quick: Controls 2
    • None

      When setting the "visible" property of a MenuItem to "false" then the item is hidden but a placeholder remains visible. A dirty work-around is to set the item's heigh to "0":

      Menu {
      	modal: true
      	id: menu
      	
      	MenuItem {
      		text: qsTr("Option 1")
      	}
      	MenuItem {
      		id: item2
      		text: qsTr("Option 2")
      	}
      	MenuItem {
      		visible: bOption3Visible
      		text: qsTr("Option 3")
      		height: bOption3Visible?item2.height:0 // hack
      	}
      }
      

        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:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes