Here the solution :
class CFileSystemModel : public QFileSystemModel
{
public:
CFileSystemModel
( QObject* Parent
) : QFileSystemModel( Parent )
{
}
virtual bool hasChildren
( const QModelIndex
& parent
= QModelIndex() ) const {
if( parent.flags() & Qt::ItemNeverHasChildren )
return false;
return QDirIterator( filePath( parent ), filter(), QDirIterator::NoIteratorFlags ).hasNext();
}
};
class CFileSystemModel : public QFileSystemModel
{
public:
CFileSystemModel( QObject* Parent ) :
QFileSystemModel( Parent )
{
}
virtual bool hasChildren( const QModelIndex& parent = QModelIndex() ) const
{
if( parent.flags() & Qt::ItemNeverHasChildren )
return false;
return QDirIterator( filePath( parent ), filter(), QDirIterator::NoIteratorFlags ).hasNext();
}
};
To copy to clipboard, switch view to plain text mode
That solves the problem of stylesheet and the problem of arrow when empty.
Bookmarks