ListView delegate isnt able to access model properties after inserting into QAbstractItemModel
-
@Christian-Ehrlicher So you think this is a qml related problem?
I would create a single/atomar add function to really make sure the add is correct but the rest looks good.
-
@Christian-Ehrlicher So you think this is a qml related problem?
@Creaperdown
Yes indeed it is, which is why I suggested this thread might be better moved to QML forum in the first place, though never mind now. -
@Creaperdown
Yes indeed it is, which is why I suggested this thread might be better moved to QML forum in the first place, though never mind now.@JonB I'll be closing this here then and moving it to the Qml section
-
C Creaperdown deleted this topic on
-
@JonB I'll be closing this here then and moving it to the Qml section
Why do you delete this thread? To start over the same discussion about the possible wrong usage of begin/endInsertRows again?
-
C Christian Ehrlicher restored this topic on
-
@JonB I'll be closing this here then and moving it to the Qml section
@Creaperdown in your model, do the following:
beginResetModel(); add new row() endResetModel(); -
@Creaperdown in your model, do the following:
beginResetModel(); add new row() endResetModel();@JoeCFD said in ListView delegate isnt able to access model properties after inserting into QAbstractItemModel:
@Creaperdown in your model, do the following:
beginResetModel(); add new row() endResetModel();If you need to reset the whole model because you insert one row, there's likely a design issue.
-
@JoeCFD said in ListView delegate isnt able to access model properties after inserting into QAbstractItemModel:
@Creaperdown in your model, do the following:
beginResetModel(); add new row() endResetModel();If you need to reset the whole model because you insert one row, there's likely a design issue.
-
@JoeCFD basically, it tells the view that everything has changed so it should reload everything as a consequence.
-
The problem was a missing reference on the container. It should have been
QList<Bookmark>&, thus it didnt update the container when I add a book. -
C Creaperdown has marked this topic as solved on