void CatchSelection(QModelIndex item)
{
if(item.row() == -1)
{
return;
}
if (item.parent().row() != -1)
{
QModelIndex idx = model()->index(item.row(), 1, item.parent());
__int64 value = model()->data(idx).toLongLong();
}
}
The above code doesn't work. I'm trying to get data out of a Qt 5.1 QTreeView when the user clicks on an item. Then I'm trying to select the 2nd column of that item (it has a number I need).
What am I missing?