Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.6.2, 6.6.3, 6.7.0
Description
Steps to reproduce:
- Run the attached reproducer.
What done in the reproducer:
- Create a ListView (gadgetListView in the reproducer) in QML, which accesses QAbstractListModel defined in C++ (myGadgetList in the reproducer).
- Each entry of the QAbstractListModel is an instance of a class defined with Q_GADGET macro (MyGadget class in the reproducer).
- Let the ListView to classify entries into sections automatically, depending on each entry's property (gadget.size), as follows:
section
{ property: "gadget.size" criteria: ViewSection.FullString delegate: sectionHeading }- This section property (dot notation access : "gadget.size") does not work. The entries in myGadgetList are not classified in sections in the ListView.
- The same approach works for myObjectList, a list of instances with Q_OBJECT macro.
Side note:
- The user is pointing out that this might be being caused by QQmlDelegateModelPrivate::variantValue(), where it seems assuming only Q_OBJECT, i.e. casting the entry to QObject pointer.
- Besides ListView Sections, Qt 6.7.0 shows a bit different behvior than 6.6.x.
The notation "object.size" and "gadget.name" work with 6.6.x, but not with 6.7.0, while "object.name" and "gadget.name" work with 6.0.x and 6.7.0 both.
(See attached qt_6_6_2.png, qt_6_6_3.png and qt_6_7_0.png)