Hi anda,
I have a QTreeWidget containing 4 columns.
I would like to toggle (hide/show) entire row based on the string at column 2. Therefore, as per your suggestion I tried the following:
QList<QTreeWidgetItem*> mSortItems; // new QList to find items in a tree
mSortItems = tree->findItems("Info", Qt::MatchExactly, 2); // tree is a pointer to QTreeWidget
QList<QTreeWidgetItem*> mSortItems; // new QList to find items in a tree
mSortItems = tree->findItems("Info", Qt::MatchExactly, 2); // tree is a pointer to QTreeWidget
To copy to clipboard, switch view to plain text mode
It has found (lets say 3 items) in the that column. Now, how can I extract the index(row number) of those 3 items?
Please help.
Added after 1 37 minutes:
for(int j = 0; j < mSortItems.count(); j ++)
{
tree->setItemHidden( mSortItems[j], false );
}
for(int j = 0; j < mSortItems.count(); j ++)
{
tree->setItemHidden( mSortItems[j], false );
}
To copy to clipboard, switch view to plain text mode
This solved the problem..thanks! :-)
Bookmarks