Thanks for response. So only elegant way to do this is create new, custom model? If I use selectedRows(), it works properly only with selectAll() method (selecting manually items does not work)
Thanks for response. So only elegant way to do this is create new, custom model? If I use selectedRows(), it works properly only with selectAll() method (selecting manually items does not work)
No, all works well with Qt stuff. And the model has nothing to do with the selection.what does not work exactely? Are you displaying all columns? Also you might want use proper selectionBehavior and selectionMode settings. (Or you can remove the non needed columns from the model.)If I use selectedRows(), it works properly only with selectAll() method (selecting manually items does not work)
Sorry, I didn't unterstood it very well, but now everything with selecting behavior is clear. Could you easily explain me how to remove columns in that model?
Use QAbstractItemModel::removeColumn() to remove non needed columns. It will save memory and provides better performance.
I dont know how to use it; especially what to give as a second argument, QModelIndex. I'm pretty sure it cant be be a single item from the model, but dont have any ideas. Can you explain me it a bit more accurately or simply write a small piece of code which will remove single column?
thanks in advance
I see right know that QFileSystemModel does not reimp removecolumns, so you can't use it. Then you have to use the selection options.
Treadstone (19th August 2010)
Thanks, used selectedRows() and it's working fine![]()
Regards
Bookmarks