From d315e012184a2b71b7b5e41869d166c05093d13d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 23 Nov 2012 15:24:48 +0100 Subject: Add the Qt::ItemNeverHasChildren flag and use it in QTreeView. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It can be used to determine whether expand() should really expand. Change-Id: If79d8c295a4ca1356e60051682b227524a065126 Reviewed-by: David Faure (KDE) Reviewed-by: Olivier Goffart Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/dialogs/qfilesystemmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/dialogs/qfilesystemmodel.cpp') diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 4d3c7a24ec..251af273b9 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -964,6 +964,8 @@ Qt::ItemFlags QFileSystemModel::flags(const QModelIndex &index) const flags |= Qt::ItemIsEditable; if (indexNode->isDir()) flags |= Qt::ItemIsDropEnabled; + else + flags |= Qt::ItemNeverHasChildren; } return flags; } -- cgit v1.2.3