Solved Why item flags exist in Models in Qt?
-
I am trying to understand why there is item flags in Qt models. Seems that it is unused all the time in all QML views with custom delegates. At the same time, user can substitute this properties with just normal
data(..., isCheckableRole)
.
https://doc.qt.io/qt-5/qt.html#ItemFlag-enumWhat is the sence of this item flags?
-
Hi
It allows a model to change the default items flags overwriting
the virtual flags method of the model without having to ask the user to set
on each item.
https://doc.qt.io/qt-5/qabstractitemmodel.html#flags -
But why item flags exist if they are not used in qml views>?
-
@Kofr
Hi
Well they are very much used in c++.
Cant say for QML but was maybe not needed with its version of a delegate.