You'll have to subclass QDirModel and reimplement the headerData() method.
Something like this :
QVariant CustomDirModel
::headerData(int section,
Qt::Orientation orientation,
int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
{
switch (section)
{
case 0:
return tr("Arborescence");
default:
}
}
}
QVariant CustomDirModel::headerData(int section,
Qt::Orientation orientation,
int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
{
switch (section)
{
case 0:
return tr("Arborescence");
default:
return QVariant();
}
}
return QVariant();
}
To copy to clipboard, switch view to plain text mode
This example applies to a QTreeView with a single column
Bookmarks