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

Setting Combobox currentIndex to -1 doesnt update view

    XMLWordPrintable

Details

    • 08a32dff66a89fb517e86d3a2232407bd37fb715

    Description

      I have a Combobox . and if I want to set currentIndex to -1,

      Current Behaviour with Qt Quick Controls using Qt5.2, stays at the same index .
      Behaviour with Qt Quick Control using Qt5.1 , shows blank data , i.e. -1 Index.
      The last behaviour is similar to widgets based combobox on Qt5.1 and Qt5.2.

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      import QtQuick.Layouts 1.0
      import QtQuick.Window 2.0
      
      ApplicationWindow {
        title: qsTr("ComboBox Test")
        width: 250
        height: 100
      
        ColumnLayout {
          Button {
            text: "reset currentIndex"
            onClicked: {
              combo.currentIndex = -1
            }
          }
      
          ComboBox {
            id: combo
            model: ["abc", "def", "ghi"]
      
            onCurrentIndexChanged: {
              console.debug(currentIndex)
            }
          }
        }
      }
      
      

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            tapadar Indrajit Tapadar (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes