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

MenuItem is not hidden when visible=false

    XMLWordPrintable

Details

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

    Description

      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
      	}
      }
      

      Attachments

        Issue Links

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes