Qt 6.11 is out! See what's new in the release
blog
How to call a method of a QModelIndex object from QML?
-
In the following example index is an object of the QModelIndex class:
var s = index.sibling(0, 0)The execution leads to the following error:
TypeError: Property 'sibling' of object QModelIndex(0,0,0x286a3e0,FileSystemModel(0x19bc150)) is not a functionThe same error type occurs with the following line:
var s = index.row()But using row as a property like in the following line works:
var s = index.rowSo, what's going wrong here? How can I call a method of a QModelIndex object in a QML file?