I am using QFileSystem Model with QTreeView, and I am able to change the text by sub classing QFileSystem model like this...
QVariant customFileSystemModel::headerData(int section,
Qt::Orientation orientation,
int role) const
{
switch(role)
{
case(Qt::DisplayRole):
{
return QString("YourText");
}
case(Qt::TextAlignmentRole):
{
return Qt::AlignLeading;
}
default:{}
}
return QFileSystemModel::headerData(section, orientation,role);
}
but I am not able to remove the leading spaces in header text, could any one suggest how to do it.