16,203
社区成员
发帖
与我相关
我的任务
分享
QVariant QMyDirModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal) {
if (role != Qt::DisplayRole)
return QVariant();
switch (section) {
case 0: return tr("11111111");
case 1: return tr("22222");
case 2: return
#ifdef Q_OS_MAC
tr("Kind", "Match OS X Finder");
#else
tr("Type", "All other platforms");
#endif
// Windows - Type
// OS X - Kind
// Konqueror - File Type
// Nautilus - Type
case 3: return tr("Date Modified");
default: return QVariant();
}
}
return QAbstractItemModel::headerData(section, orientation, role);
}