I have some QML code using QtQuick.Controls 1.4
from Qt 5.6.1. I have some wrappers around various controls, such as ComboBox
; these make use of Style
objects. For instance, MyComboBox
is a ComboBox
with a custom ComboBoxStyle
.
Every so often, when certain components are loaded, the control
property in the Style
object is null
:
In MyComboBox.qml
:
...
style: ComboBoxStyle {
...
label: Label {
text: control.currentText
...
The resulting error output is:
qrc:/MyComboBox.qml:72: TypeError: Cannot read property 'currentText' of null
Restarting the application typically fixes the error.
I have no idea how this could happen or why the error appears non-deterministic. What can I do to investigate?