diff options
author | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2010-03-25 07:42:21 (GMT) |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2010-03-25 07:42:21 (GMT) |
commit | 20779098f4eb73f8789d704e1a2818ddbbf5b4d2 (patch) | |
tree | b1c4e3edb447ee47f9bc724f106d1bbefcff5456 /src/gui/itemviews | |
parent | 8cc346604ed1e1504964772613ed9fe531361f69 (diff) | |
parent | 194013d9db1b3e4ba6f56a864f3b64f523202948 (diff) | |
download | Qt-20779098f4eb73f8789d704e1a2818ddbbf5b4d2.zip Qt-20779098f4eb73f8789d704e1a2818ddbbf5b4d2.tar.gz Qt-20779098f4eb73f8789d704e1a2818ddbbf5b4d2.tar.bz2 |
Merge remote branch 'main/4.7' into 4.7
Conflicts:
demos/declarative/minehunt/minehunt.cpp
src/declarative/qml/qdeclarativecompiler.cpp
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qdirmodel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/itemviews/qdirmodel.cpp b/src/gui/itemviews/qdirmodel.cpp index 378a238..48599bc 100644 --- a/src/gui/itemviews/qdirmodel.cpp +++ b/src/gui/itemviews/qdirmodel.cpp @@ -1182,12 +1182,18 @@ QFileInfo QDirModel::fileInfo(const QModelIndex &index) const void QDirModelPrivate::init() { + Q_Q(QDirModel); filters = QDir::AllEntries | QDir::NoDotAndDotDot; sort = QDir::Name; nameFilters << QLatin1String("*"); root.parent = 0; root.info = QFileInfo(); clear(&root); + QHash<int, QByteArray> roles = q->roleNames(); + roles.insertMulti(QDirModel::FileIconRole, "fileIcon"); // == Qt::decoration + roles.insert(QDirModel::FilePathRole, "filePath"); + roles.insert(QDirModel::FileNameRole, "fileName"); + q->setRoleNames(roles); } QDirModelPrivate::QDirNode *QDirModelPrivate::node(int row, QDirNode *parent) const |