Thanks for your help!
My problem is, that when I use 3 additional lines in order to have the treeview show the entries in full row style, the autoselection does not work anymore:
#include <QtGui>
int main(int argc, char* argv[])
{
view.setModel(&model);
// To enable full-row style:
view.
setRootIndex(model.
index(QDir::homePath()));
view.setItemsExpandable(false);
view.setRootIsDecorated(false);
view.setCurrentIndex(model.index(0, 0));
view.show();
return app.exec();
}
#include <QtGui>
int main(int argc, char* argv[])
{
QApplication app(argc,argv);
QTreeView view;
QDirModel model;
view.setModel(&model);
// To enable full-row style:
view.setRootIndex(model.index(QDir::homePath()));
view.setItemsExpandable(false);
view.setRootIsDecorated(false);
view.setCurrentIndex(model.index(0, 0));
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I used the whole stuff with these settings originally - I never tried without these 3 lines before, so I did not see it work...
Any idea?
Thanks
Bookmarks