Hello,
I was just wondering how to change the order of columns as they appear in QTreeView when using QDirModel. Here is a snippet of code:
// Declare the new objects.
// Set the file system structure parameters.
Directory_Model
->setFilter
(QDir::AllDirs);
Directory_Model
->setSorting
(QDir::Time);
// Set the tree model (visual) parameters.
this->QTreeView::setModel(Directory_Model);
this->setColumnHidden(1,1);
this->setColumnHidden(2,1);
//this->setColumnHidden(3,1); //This crashes the widget. Why does this happen?
// Declare the new objects.
Directory_Model = new QDirModel;
File_Path = new QString;
// Set the file system structure parameters.
Directory_Model->setFilter(QDir::AllDirs);
Directory_Model->setSorting(QDir::Time);
// Set the tree model (visual) parameters.
this->QTreeView::setModel(Directory_Model);
this->setColumnHidden(1,1);
this->setColumnHidden(2,1);
//this->setColumnHidden(3,1); //This crashes the widget. Why does this happen?
To copy to clipboard, switch view to plain text mode
As it stands, I can see the directory tree, and then the modification time - in that order from left to right. I want this order reversed... how can this be done?
JS.
Bookmarks