Can anyone tell me how i can set the first item of the qlistview every time i click an item ? I am using qfilesystemmodel along with qListView. Basically I want the first item shown by the model to get selected by default.
This should do the job.
view->setCurrentIndex(fsModel->index(0, 0));
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With