Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.3, 6.5.5, 6.6.3
-
MacBook M1, macOS 14.4.1, Clang 15.0.0, Xcode 15;
Windows 11, MSVC2019 kit
-
-
789f7316b (dev), 6561344dd (dev), cc3d7ef32 (6.8), b2ff845f8 (6.8), dd7d8f38b (6.7), 7c7b222e0 (6.7), 385f7b575 (tqtc/lts-6.5), a90eb9500 (tqtc/lts-6.5), a9af10e1e (dev), 2ea3abed0 (6.8), 8d811bb88 (6.7), 4bd303b2a (tqtc/lts-6.5), 4bb16ce2c (dev)
Description
I believe I've discovered a regression in Qt 6.5+ that seems to be a timing issue regarding creation of components and resetting of the list model. My guess is that the class sends a signal about the model having been reset before QML is ready to receive it and for some reason the GridView fails to pick up the data correctly.
I have attached a minimal project. This runs fine in Qt 6.4.2, displaying 3 green squares with sound names in them, and the console output:
QML debugging is enabled. Only use this in a safe environment.
qml: index: 0 name: Clarinet
qml: index: 1 name: Bassoon
qml: index: 2 name: Piano
qml: SoundListModel count: 3
However running the same project in Qt 6.5.3, 6.5.5 or 6.6.3 results in nothing being displayed and the output:
QML debugging is enabled. Only use this in a safe environment.
qml: SoundListModel count: 3
Clearly the change in count is getting through but not the change to the actual model.
In the attached code you'll see a commented out Timer item. If you uncomment this, the GridView populates correctly. My belief is that it causes the model to reset on the next event loop after the QML component has been created, so the signals are correctly picked up.
For anyone else discovering this issue, the Timer item is a workaround.
Attachments
Issue Links
- relates to
-
QTBUG-129974 ListView add 2x more items when Model.roleNames is updated between beginResetModel and endResetModel
- Closed