c++ - How to change default expand/collapse sub-items in QTreeWidget? -


i tried create simple treeview following code in qt 4.8

qtreewidgetitem *city = new qtreewidgetitem(ui->trvcompetitions); city->settext(0, tr("city"));  (new qtreewidgetitem(city))->settext(0, tr("stockholm")); (new qtreewidgetitem(city))->settext(0, tr("helsinki")); (new qtreewidgetitem(city))->settext(0, tr("copenhagen"));  qtreewidgetitem *other = new qtreewidgetitem(ui->trvcompetitions); other->settext(0, tr("other"));  (new qtreewidgetitem(other))->settext(0, tr("london")); (new qtreewidgetitem(other))->settext(0, tr("tokio")); (new qtreewidgetitem(other))->settext(0, tr("hanoi")); 

and treeview got

mytreeview

i have read this article , want treeview has expand/collapse sub-items that

the treeview want get

how can change treeview this?

thank!

after reading more documents qtreewidget, realized treeview can customized. have modified treeview following this post , result desired.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -