Home > Mobile >  QML Treeview load warning.
QML Treeview load warning.

Time:09-17

QML when using the Treeview in c + + inherits from QAbstractItemModel data model, at the time of loading appeared a lot of warning:
"Could not convert argument at" 2
"The expression for the index @ file:///D:/Qt/Qt5.12.3/5.12.3/mingw73_32/qml/QtQuick/Controls/Private/TreeViewItemDelegateLoader.qml:84"
"The expression for the onCompleted @ file:///D:/Qt/Qt5.12.3/5.12.3/mingw73_32/qml/QtQuick/Controls/Private/BasicTableView.qml:546"
"Passing incompatible the arguments to the c + + functions provides the from JavaScript is dangerous and deprecated."
"This will throw a JavaScript TypeError in future releases of Qt!"

Because virtual function QModelIndex index (int row, int column, const QModelIndex & amp; The parent=QModelIndex const ());
Finally a default argument is QModelIndex () not null, so I took TreeViewItemDelegateLoader. This line of QML null commented out, but be warned,
Readonly property var index: model? "_q_TreeView_ModelIndex" model [] : __treeModel index (1, 1)//, null

What can thoroughly the solution?
  •  Tags:  
  • Qt
  • Related