4#ifndef QFILESYSTEMMODEL_P_H
5#define QFILESYSTEMMODEL_P_H
18#include <QtGui/private/qtguiglobal_p.h>
21#include <private/qabstractitemmodel_p.h>
37class ExtendedInformation;
100 return info->isDir();
101 if (children.size() > 0)
109 inline bool isSymLink(
bool ignoreNtfsSymLinks =
false)
const {
return info &&
info->isSymLink(ignoreNtfsSymLinks); }
150 return visibleChildren.indexOf(childName);
161 if (!
path.isEmpty()) {
162 if (
path.endsWith(u
'/'))
167 child->updateIcon(iconProvider,
child->fileName);
179 if (!
path.isEmpty()) {
180 if (
path.endsWith(u
'/'))
183 child->retranslateStrings(iconProvider,
path + u
'/' +
child->fileName);
185 child->retranslateStrings(iconProvider,
child->fileName);
189 QHash<QFileSystemModelNodePathKey, QFileSystemNode *>
children;
193 int dirtyChildrenIndex = -1;
194 bool populatedChildren =
false;
208 return (indexNode != &root && !
index.isValid());
211 QFileSystemNode *node(
const QString &
path,
bool fetch =
true)
const;
214 bool filtersAcceptsNode(
const QFileSystemNode *node)
const;
215 bool passNameFilters(
const QFileSystemNode *node)
const;
216 void removeNode(QFileSystemNode *parentNode,
const QString &
name);
218 void addVisibleFiles(QFileSystemNode *parentNode,
const QStringList &newFiles);
219 void removeVisibleFile(QFileSystemNode *parentNode,
int visibleLocation);
227 if (row < parent->dirtyChildrenIndex)
240 return QFileSystemModel::tr(
"My Computer");
242 return QFileSystemModel::tr(
"Computer");
247 if (!delayedSortTimer.isActive())
248 delayedSortTimer.start(0);
261 void performDelayedSort();
262 void fileSystemChanged(
const QString &
path,
const QList<std::pair<QString, QFileInfo>> &);
266#if QT_CONFIG(filesystemwatcher)
271 std::unique_ptr<QFileInfoGatherer> fileInfoGatherer;
275#if QT_CONFIG(regularexpression)
277 std::vector<QRegularExpression> nameFiltersRegexps;
278 void rebuildNameFilterRegexps();
296 bool forceSort =
true;
297 bool readOnly =
true;
298 bool setRootPath =
false;
299 bool nameFilterDisables =
true;
302 bool disableRecursiveSort =
false;
virtual QIcon icon(IconType) const
Returns an icon set for the given type, using the current icon theme.
virtual QString type(const QFileInfo &) const
Returns the type of the file described by info.
\inmodule QtCore\reentrant
void populate(const QExtendedInformation &fileInfo)
void updateIcon(QAbstractFileIconProvider *iconProvider, const QString &path)
bool hasInformation() const
QFileInfo fileInfo() const
QFile::Permissions permissions() const
QDateTime lastModified(const QTimeZone &tz) const
QHash< QFileSystemModelNodePathKey, QFileSystemNode * > children
QList< QString > visibleChildren
bool isSymLink(bool ignoreNtfsSymLinks=false) const
int visibleLocation(const QString &childName)
bool isExecutable() const
bool caseSensitive() const
void retranslateStrings(QAbstractFileIconProvider *iconProvider, const QString &path)
QHash< const QFileSystemNode *, bool > bypassFilters
QHash< QString, QString > resolvedSymLinks
QModelIndex index(const QString &path, int column=0)
bool isHiddenByFilter(QFileSystemNode *indexNode, const QModelIndex &index) const
QList< Fetching > toFetch
QBasicTimer fetchingTimer
int translateVisibleLocation(QFileSystemNode *parent, int row) const
static QString myComputer()
The QFileSystemModel class provides a data model for the local filesystem.
The QIcon class provides scalable icons in different modes and states.
qsizetype size() const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
static QString displayName(CGDirectDisplayID displayID)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
QString QFileSystemModelNodePathKey
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei const GLuint * paths
GLenum GLenum GLsizei void GLsizei void * column
GLsizei const GLchar *const * path
GLenum GLenum GLsizei void * row
bool operator>(const QPoint &a, const QPoint &b)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
#define QT_REQUIRE_CONFIG(feature)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
static int compare(quint64 a, quint64 b)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]
const QFileSystemNode * node