qt - QTreeView items editable and selecting whole rows -


i have qtreeview wich alread connected model (qstandarditemmodel), tree filled , can display it.

when double click on items, item edit mode opened, able modify fields content.

i not want that!

  1. i have fields fixed , not editable.
  2. further on, complete row should selected, when clicking in tree.

i appreciate help, sincerly

for 1.

qstandarditem* item = new standarditem(qstring(itemnamestring)); item->seteditable(false); 

but here, have set each field, when building qstandarditemmodel. don't know, if effective you? possibly not, when there many entries?

for 2. try

  ui->treeview->setselectionbehavior (qabstractitemview::selectrows); 

Comments