qml listview ListView.view accessed from highlight is null
Unsolved
QML and Qt Quick
-
ListView { width: 274 height: count > 0 ? 0 : contentHeight spacing: 2 highlightFollowsCurrentItem: true model: assignTargetModel //delegate: lvDelegate highlight: lvHighlight Component { id: lvHighlight Item { id: item width: 274 height: 56 Image { source: (item.index === /*item.*/ListView.view.count - 1) ? "qrc:/Analysis/assets/target5_bg2_3615_778.png" : "qrc:/Analysis/assets/a_b_bg1_3615_757.png" } } }
Right in
delegate
, I guesshighlight
is created dynamically and thehighlight
is undefined by default. And so theListView.view
has not been attached todelegate
.
If so, this is a terrible way that can cause unintentional errors.