Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946
Extracting QModelIndex from QTreeWidgetItem
-
Is there a way to extract the QModelIndex given a QTreeWidgetItem and a column ?
i.e.
QModelIndex index = item->magic(column);
-
Solved it finally, trick is to traverse the item hierarchy and construct the index from that.
-
From http://doc.qt.io/qt-5/qtreewidget.html#indexFromItem there's a:
QModelIndex QTreeWidget::indexFromItem(const QTreeWidgetItem *item, int column = 0) const
It's protected, so do you have your own
QTreeWidget
-derived class?