well, I tried this one:
QModelIndex modelIndex
= list
->rootIndex
();
// u have to find the model index of the first item here list->setCurrentIndex(modelIndex);
QListWidget *list = new QListWidget();
list->setSelectionMode(QAbstractItemView::SingleSelection);
QModelIndex modelIndex = list->rootIndex(); // u have to find the model index of the first item here
list->setCurrentIndex(modelIndex);
To copy to clipboard, switch view to plain text mode
but it didn't work, so I am gonna stick with this one for now:
listWidget->item(0)->setSelected(true);
listWidget->item(0)->setSelected(true);
To copy to clipboard, switch view to plain text mode
and I'll try to read the model-view-introduction sometimes later...
Thanks for your help.
Bookmarks