Hello friends,
how can I get the itemtext from my Teeview??
I´am searching now about 1 hour. Have any an idea???
Hello friends,
how can I get the itemtext from my Teeview??
I´am searching now about 1 hour. Have any an idea???
You can use QAbstractItemModel::data with the QAbstractItemView::currentIndex model index and a display role to get the text of the current item.
Qt Code:
QString txt; if(tree->currentIndex().isValid()) { txt = tree->model()->data(tree->currentIndex(), Qt::DisplayRole).toString(); }To copy to clipboard, switch view to plain text mode
Thank you!!! It rocks!
Bookmarks