PDA

View Full Version : problem in QTreewidget



jyoti
28th November 2006, 10:56
hi all
i have small problem in tree widget
i want to select only single mode for treewidget as like listview have (ListVew->setSelectionMode(ListView::single))

is there any way for tree widget means in treewidget if i search for item particular that only selected in tree widget

and futher i wannna use clearSelection() for tree widget
as i had used in listView(ListView->clearSelection())


plz ell me the solution as soon as possible

jpn
28th November 2006, 11:04
i have small problem in tree widget
i want to select only single mode for treewidget as like listview have (ListVew->setSelectionMode(ListView::single))

is there any way for tree widget means in treewidget if i search for item particular that only selected in tree widget


QAbstractItemView::setSelectionMode() (http://doc.trolltech.com/4.2/qabstractitemview.html#selectionMode-prop)


treeWidget->setselectionMode(QAbstractItemView::SingleSelectio n);



and futher i wannna use clearSelection() for tree widget
as i had used in listView(ListView->clearSelection())


QAbstractItemView::selectionModel()
QItemSelectionModel::clear()


treeWidget->selectionModel()->clearSelection();

Edit: It shouldn't be that hard to search the docs. For example, try typing "selectionMode" or "clearSelection" into Qt Assistant's index tab. You even knew the correct terms.