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

PlaceholderText on ComboBox does not show

    XMLWordPrintable

Details

    • Windows

    Description

      Setting "placeholderText" on the contentItem of a ComboBox does not have any effect.

      ComboBox {
        id: comboCategory_
        ...
      
        Component.onCompleted: {
          console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
          console.log( "ContentItem is    : " + comboCategory_.contentItem )
          console.log( "placeholderText is: " + comboCategory_.contentItem.placeholderText )
          comboCategory_.contentItem.placeholderText = "<category>"
          console.log( "placeholderText is: " + comboCategory_.contentItem.placeholderText )
          console.log("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")
        }
      
      }

       
       
      The above prints as expected but the placeholder text is not shown on the control when the selection text is empty.
       
      The attached qml file can be run to show the issue:
       
      See the discussion on the mailing list for more information and context: https://lists.qt-project.org/pipermail/interest/2019-September/033732.html
       
      PS: Setting the "selectByMouse" property on the contentItem works as expected (related to QTBUG-71406)

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-77978
          # Subject Branch Project Status CR V

          Activity

            People

              axelspoerl Axel Spoerl
              thebadger101 Carel Combrink
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes