We are using QtQuick.Controls 2.2 and can't downgrade due to various reasons. When we use Combobox util from QML, it doesn't appear with selectByMouse field which was introduced in 1.4 version.
Our requirement is -- to be able to select the text in the combobox for copying purpose as well as have a dropdown menu.
How to fix this issue; Is there any alternative?
As of Qt 5.9 / Quick Controls 2.2, the
ComboBoxnow contains aTextFieldto show the current text, if theComboBoxis set aseditible. TextField does have theselectByMouseproperty you require, only it is not exposed as a property of theComboBoxso it is not accessible by QML. However, it can be accessed in the javascript, e.g. from the Component.onCompleted attached signal handler.For example: