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

QQuickComboBox editable: unexpected behavior on accepted()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.12.0
    • Quick: Controls 2
    • None
    • Qt 5.12.0 MSVC2017 Windows 10 x64
    • Windows

    Description

      In an editable QtQuick ComboBox, when pressing Enter, the accepted() signal is emitted. "This signal is emitted when the Return or Enter key is pressed on an editable combo box. If the confirmed string is not currently in the model, the currentIndex will be set to -1 and the currentText will be updated accordingly." - this is a citation from https://doc.qt.io/qt-5/qml-qtquick-controls-combobox.html#accepted-signal. The problem is that editText string property and model strings are compared by case-insensitive instead of case-sensitive way (as it is documented). So if you type "one" and your model contains an item "ONE", the content of editText is changed to "ONE" and then onAccepted() is called. It prevents from adding strings in different cases to the model.

      Attachments

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              aleksey.tsiberev Aleksey Tsiberev
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: