0

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?

Kyle Strand
  • 15,941
  • 8
  • 72
  • 167
  • It smells like the issue that was fixed by the 5.6.1-1 release: https://blog.qt.io/blog/2016/06/22/qt-5-6-1-1-released/ – jpnurmi Aug 10 '16 at 22:39
  • @jpnurmi Hmmm--my app isn't *crashing*, but that definitely looks like it could be related, and in any case that sounds like a pretty ugly potential bug to be working with if I ever do run up against it. I'll give the bugfix release a try and see if that fixes my issue. This "long term support" for 5.6 is turning out to be................disappointing. – Kyle Strand Aug 10 '16 at 23:31
  • I think Tuukka's description is slightly misleading. The bug caused a bit larger QML apps to explode in a way that such `cannot read property 'foo' of null` errors were suddenly all over the place. If I remember correctly, that particular paper bag bug did not cause a literal crash. Why is it disappointing? The hotfix was released right away when the severity of the problem was realized. – jpnurmi Aug 11 '16 at 09:43
  • @jpnurmi Well, assuming there aren't still critical bugs in 5.6.1-1, that was the first such release of this LTS series in the *entire first 6 months since 5.6 was originally released*, and it's release number three within that time frame, meaning that, for companies (like mine) in regulated industries developing embedded devices that aren't updated for years at a time and have long lifespans, the series seems dangerously unstable. Additionally, I repeatedly checked the Qt 5.6 release page to see if a new release had fixed the 5.6.1 known issues yet, but 5.6.1-1 isn't listed there. – Kyle Strand Aug 11 '16 at 14:40
  • Note that 6 month is 1/6 the promised duration of the LTS support (three years). – Kyle Strand Aug 11 '16 at 14:42
  • @jpnurmi Anyway, thanks for letting me know about the 5.6.1-1 release. Sorry if I seem bitter--it's just that trying to use 5.6 has not been a pleasant experience, and we are considering downgrading back to 5.5 before the release the product we're developing, even though 5.6 has QtCharts 2.1, which has at least one feature we'd need to implement ourselves if we reverted to 2.0. – Kyle Strand Aug 11 '16 at 18:58

1 Answers1

0

This appears to have been fixed in release 5.6.1-1; since upgrading, we have not observed this error. Presumably we were simply observing one of the less-critical symptoms of QTBUG-53761.

Credit to jpnurmi for recognizing the similarity of the symptoms I described to the behavior of the bug, and for notifying me that a release with a fix was available (which, sadly, is not evident on the Qt 5.6 release-series page).

Kyle Strand
  • 15,941
  • 8
  • 72
  • 167