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

QQuickComboBox editable: unexpected behavior on accepted()

XMLWordPrintable

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

      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.

        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
            aleksey.tsiberev Aleksey Tsiberev
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes