Hello!
I have a problem. My program's functionality depends on type of current item in QTreeWidget and of the count of selected items:
// Signal currentItemChanged(...) handler
{
..
if (tree->selectedItems().count() > 1)
{
...
}
else
{
if (pCurItem->data(0, Qt::UserRole).toString() == "example1")
{
...
}
else
{
...
}
}
}
// Signal currentItemChanged(...) handler
void Class1::Handler(QTreeWidgetItem* pCurItem, QTreeWidgetItem * pPrevItem)
{
..
if (tree->selectedItems().count() > 1)
{
...
}
else
{
if (pCurItem->data(0, Qt::UserRole).toString() == "example1")
{
...
}
else
{
...
}
}
}
To copy to clipboard, switch view to plain text mode
QTreeWidget selection mode is ExtendedSelection.
For example, i select in tree 5 items (by mouse). It works correct.
> Item1
> Item2
> Item3
> Item4
> Item5
Then, i click to one item of that 5.
Item1
Item2
> Item3
Item4
Item5
And here is the problem. My handler works as if it was selected 5 items...Maybe QTreeWidget class has some function, that force tree to refresh selected list?
Thank you!
Bookmarks