Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
6.5.3, 6.7.0
-
None
Description
It is not possible to assign editText value, because it is unset on model data changes. This makes editable ComboBox useless in my situation. And there are no workarounds.
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true Column { // OK no model ComboBox { editable: true currentIndex: -1 editText: "Qt Test" } // FAIL simple model ComboBox { editable: true currentIndex: -1 editText: "Qt Test" model: 5 } // FAIL simple model 2 ComboBox { editable: true currentIndex: -1 editText: "Qt Test" model: ["cat", "dog"] } // FAIL advanced empty model ComboBox { editable: true currentIndex: -1 editText: "Qt Test" model: _model } // INITIALLY ok, because delayed assignment, but FAIL when new item added with button ComboBox { editable: true currentIndex: -1 Component.onCompleted: editText = "Qt Test" model: _model } Button { text: "ADD" onClicked: { _model.append({text: "cat"}); } } } ListModel { id: _model } }
Even if text is changed via keyboard and "ADD" pressed, then value is lost again.