PDA

View Full Version : Set Focus on created QStandardItem and edit Text



blackbubblegum
28th February 2012, 10:25
Hi all,

I have an application similar to a file browser, which works with a QTreeView. At some point I need to add new items into the model (QstandardItemModel), where the name is to be set by the user. As interaction I would like to have it similar to creating a folder in windows. The action is triggered and the Item is created, but the name field is selected and the cursor enabled to set the name.

Is this possible using Qt? Where can I set the QStandardItem to be edited?

Thanks for your help,
bbg

mentalmushroom
29th February 2012, 10:52
take a look at void QAbstractItemView::edit ( const QModelIndex & index )