This handy class takes a copy of a TreeViewItem's openness when you create it, and restores that openness state when its destructor is called. More...
Public Member Functions | |
| OpennessRestorer (TreeViewItem &treeViewItem) | |
| ~OpennessRestorer () | |
This handy class takes a copy of a TreeViewItem's openness when you create it, and restores that openness state when its destructor is called.
This can very handy when you're refreshing sub-items - e.g.
void MyTreeViewItem::updateChildItems() { OpennessRestorer openness (*this); // saves the openness state here.. clearSubItems(); // add a bunch of sub-items here which may or may not be the same as the ones that // were previously there addSubItem (... // ..and at this point, the old openness is restored, so any items that haven't // changed will have their old openness retained. }
| TreeViewItem::OpennessRestorer::OpennessRestorer | ( | TreeViewItem & | treeViewItem | ) |