25struct QQmlModelIndexValueType
29 Q_PROPERTY(
int row READ row CONSTANT FINAL)
30 Q_PROPERTY(
int column READ column CONSTANT FINAL)
31 Q_PROPERTY(QModelIndex parent READ parent FINAL)
32 Q_PROPERTY(
bool valid READ isValid CONSTANT FINAL)
33 Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT FINAL)
34 Q_PROPERTY(quint64 internalId READ internalId CONSTANT FINAL)
37 QML_EXTENDED(QQmlModelIndexValueType)
38 QML_FOREIGN(QModelIndex)
39 QML_ADDED_IN_VERSION(2, 0)
42 Q_INVOKABLE QString toString()
const
43 {
return QLatin1String(
"QModelIndex") + propertiesString(v); }
45 Q_REVISION(6, 7) Q_INVOKABLE QVariant data(
int role = Qt::DisplayRole)
const
46 {
return v.data(role); }
48 inline int row()
const noexcept {
return v.row(); }
49 inline int column()
const noexcept {
return v.column(); }
50 inline QModelIndex parent()
const {
return v.parent(); }
51 inline bool isValid()
const noexcept {
return v.isValid(); }
52 inline QAbstractItemModel *model()
const noexcept
53 {
return const_cast<QAbstractItemModel *>(v.model()); }
54 quint64 internalId()
const {
return v.internalId(); }
56 static QString propertiesString(
const QModelIndex &idx);
58 static QPersistentModelIndex toPersistentModelIndex(
const QModelIndex &index)
59 {
return QPersistentModelIndex(index); }
61 operator QModelIndex()
const {
return v; }