11#include <QtCore/qcollator.h>
12#if QT_CONFIG(regularexpression)
13# include <QtCore/qregularexpression.h>
19# include <QtCore/QVarLengthArray>
133 return d->node(
index)->fileInfo();
176#if QT_CONFIG(filesystemwatcher) && defined(Q_OS_WIN)
179 const QStringList watchedPaths =
d->unwatchPathsAt(aindex);
183#if QT_CONFIG(filesystemwatcher) && defined(Q_OS_WIN)
185 d->watchPaths(watchedPaths);
228 const int i =
d->translateVisibleLocation(parentNode,
row);
272 if (!
index.isValid())
283 || strShortPath ==
"."_L1 || strShortPath ==
".."_L1)
295 DWORD
result = ::GetLongPathName((
wchar_t*)inputString.
utf16(),
300 result = ::GetLongPathName((
wchar_t*)inputString.
utf16(),
340 if ((pathElements.isEmpty())
341#
if !defined(Q_OS_WIN)
348 QChar separator = u
'/';
352 QString host =
"\\\\"_L1 + pathElements.constFirst();
358 trailingSeparator =
"\\"_L1;
377 pathElements.pop_front();
380 elementPath.
append(separator);
382 if (!pathElements.at(0).contains(u
':')) {
384 pathElements.prepend(rootPath);
386 if (pathElements.at(0).endsWith(u
'/'))
387 pathElements[0].chop(1);
392 pathElements.prepend(
"/"_L1);
397 for (
int i = 0;
i < pathElements.size(); ++
i) {
398 QString element = pathElements.at(
i);
400 elementPath.
append(separator);
401 elementPath.
append(element);
402 if (
i == pathElements.size() - 1)
403 elementPath.
append(trailingSeparator);
422 if (alreadyExisted) {
424 || (
parent->caseSensitive()
426 || (!
parent->caseSensitive()
428 alreadyExisted =
false;
432 if (!alreadyExisted) {
440#if QT_CONFIG(filesystemwatcher)
455 if (!
p->bypassFilters.contains(
node))
456 p->bypassFilters[
node] = 1;
460 p->toFetch.append(std::move(
f));
476 if (
event->timerId() ==
d->fetchingTimer.timerId()) {
477 d->fetchingTimer.stop();
478#if QT_CONFIG(filesystemwatcher)
479 for (
int i = 0;
i <
d->toFetch.size(); ++
i) {
482 d->fileInfoGatherer.fetchExtendedInformation(
d->toFetch.at(
i).dir,
501 if (!
index.isValid())
504 if (
n->hasInformation())
515 if (!
index.isValid())
517 return d->node(
index)->size();
526 if (!
index.isValid())
528 return d->node(
index)->type();
561 if (!
index.isValid())
563 return d->node(
index)->lastModified(
tz);
572 if (!
d->indexValid(
index))
578 if (parentNode ==
nullptr || parentNode == &
d->root)
584 int visualRow =
d->translateVisibleLocation(grandParentNode, grandParentNode->
visibleLocation(grandParentNode->
children.value(parentNode->
fileName)->fileName));
625 return (indexNode->
isDir());
652#if QT_CONFIG(filesystemwatcher)
667 return d->root.visibleChildren.size();
688#if QT_CONFIG(filesystemwatcher)
694#if QT_CONFIG(filesystemwatcher)
708 if (!
index.isValid() ||
index.model() !=
this)
717 switch (
index.column()) {
723 qWarning(
"data: invalid display value column %d",
index.column());
734#if QT_CONFIG(filesystemwatcher)
736 if (
d->node(
index)->isDir())
762 if (!
index.isValid())
776 return size(
n->size());
789 if (!
index.isValid())
791#if QT_CONFIG(datestring)
804 if (!
index.isValid())
814 if (!
index.isValid())
819 fileInfoGatherer.resolveSymlinks() &&
835 if (!dirNode->volumeName.isEmpty())
836 return dirNode->volumeName;
846 if (!
index.isValid())
866 if (newName == oldName)
874#if QT_CONFIG(filesystemwatcher) && defined(Q_OS_WIN)
877 const QStringList watchedPaths =
d->unwatchPathsAt(idx);
879 if (!
QDir(parentPath).rename(oldName, newName)) {
880#if QT_CONFIG(filesystemwatcher) && defined(Q_OS_WIN)
881 d->watchPaths(watchedPaths);
900 std::unique_ptr<QFileSystemModelPrivate::QFileSystemNode> nodeToRename(parentNode->
children.take(oldName));
901 nodeToRename->fileName = newName;
902 nodeToRename->parent = parentNode;
903#if QT_CONFIG(filesystemwatcher)
906 nodeToRename->isVisible =
true;
907 parentNode->
children[newName] = nodeToRename.release();
941 returnValue =
tr(
"Name");
944 returnValue =
tr(
"Size");
949 tr(
"Kind",
"Match OS X Finder");
951 tr(
"Type",
"All other platforms");
959 returnValue =
tr(
"Date Modified");
973 if (!
index.isValid())
977 if (
d->nameFilterDisables && !
d->passNameFilters(indexNode)) {
985 if (!indexNode->
isDir())
991 if (indexNode->
isDir())
1023 switch (sortColumn) {
1043 if (sizeDifference == 0)
1046 return sizeDifference < 0;
1091 if (indexNode->
children.size() == 0)
1096 for (
auto iterator = indexNode->
children.constBegin(), cend = indexNode->
children.constEnd(); iterator != cend; ++iterator) {
1098 values.append(iterator.value());
1100 iterator.value()->isVisible =
false;
1116 for (
int i = 0;
i <
q->rowCount(
parent); ++
i) {
1132 if (
d->sortOrder ==
order &&
d->sortColumn ==
column && !
d->forceSort)
1144 if (!(
d->sortColumn ==
column &&
d->sortOrder !=
order && !
d->forceSort)) {
1148 d->forceSort =
false;
1154 for (
const auto &[node, col]: std::as_const(oldNodes))
1155 newList.
append(
d->index(node, col));
1182 for (;
it != indexes.
end(); ++
it)
1186 data->setUrls(urls);
1206 bool success =
true;
1291 QFileSystemModel::Options previousOptions =
options();
1326#if QT_CONFIG(filesystemwatcher)
1334 QAbstractFileIconProvider::Options providerOptions = provider->options();
1337 provider->setOptions(providerOptions);
1339 qWarning(
"Setting QFileSystemModel::DontUseCustomDirectoryIcons has no effect when no provider is used");
1346 QFileSystemModel::Options
result;
1348#if QT_CONFIG(filesystemwatcher)
1372 &&
d->fileInfoGatherer.resolveSymlinks()
1374 &&
d->resolvedSymLinks.contains(fullPath)
1375 && dirNode->
isDir()) {
1381 QFileInfo resolvedInfo = canonicalNode->fileInfo();
1382 if (!canonicalNode->hasInformation())
1384 if (resolvedInfo.
exists())
1394 if (!
index.isValid())
1407#if !defined(Q_OS_WIN)
1408 if ((fullPath.
size() > 2) && fullPath[0] == u
'/' && fullPath[1] == u
'/')
1409 fullPath = fullPath.
mid(1);
1433#if QT_CONFIG(filesystemwatcher)
1437 return d->index(node);
1446 return d->node(
index)->permissions();
1467 QString longNewPath = qt_GetLongPathName(newPath);
1472 QString longNewPath = newPath;
1478 d->setRootPath =
true;
1484 if (
d->rootDir.path() == longNewPath)
1487 auto node =
d->node(longNewPath);
1489 if (node && node->hasInformation())
1490 newPathInfo = node->fileInfo();
1495 if (!showDrives && !newPathInfo.
exists())
1501#if QT_CONFIG(filesystemwatcher)
1502 d->fileInfoGatherer.removePath(
rootPath());
1507 d->node(
rootPath())->populatedChildren =
false;
1511 d->rootDir =
QDir(longNewPath);
1515 d->rootDir.setPath(
""_L1);
1517 newRootIndex =
d->index(
d->rootDir.path());
1521 d->forceSort =
true;
1523 return newRootIndex;
1534 return d->rootDir.path();
1557#if QT_CONFIG(filesystemwatcher)
1558 d->fileInfoGatherer.setIconProvider(provider);
1560 d->root.updateIcon(provider,
QString());
1568#if QT_CONFIG(filesystemwatcher)
1570 return d->fileInfoGatherer.iconProvider();
1589 const bool changingCaseSensitivity =
1592 if (changingCaseSensitivity)
1593 d->rebuildNameFilterRegexps();
1594 d->forceSort =
true;
1624#if QT_CONFIG(filesystemwatcher)
1626 d->fileInfoGatherer.setResolveSymlinks(
enable);
1634#if QT_CONFIG(filesystemwatcher)
1636 return d->fileInfoGatherer.resolveSymlinks();
1672 if (
d->nameFilterDisables ==
enable)
1674 d->nameFilterDisables =
enable;
1675 d->forceSort =
true;
1682 return d->nameFilterDisables;
1690#if QT_CONFIG(regularexpression)
1693 if (!
d->bypassFilters.isEmpty()) {
1695 d->bypassFilters.clear();
1699 for (
const auto &persistentIndex : persistentList) {
1702 if (
d->bypassFilters.contains(node))
1705 d->bypassFilters[node] =
true;
1712 d->rebuildNameFilterRegexps();
1713 d->forceSort =
true;
1725#if QT_CONFIG(regularexpression)
1727 return d->nameFilters;
1738#if QT_CONFIG(filesystemwatcher)
1741 d->root.retranslateStrings(
d->fileInfoGatherer.iconProvider(),
QString());
1752#if QT_CONFIG(filesystemwatcher)
1755 d->fileInfoGatherer.removePath(
path);
1770 if (parentNode->
children.size() == 0)
1774 std::sort(newFiles.begin(), newFiles.end());
1775 for (
auto i = parentNode->
children.constBegin(), cend = parentNode->
children.constEnd();
i != cend; ++
i) {
1776 QStringList::iterator iterator = std::lower_bound(newFiles.begin(), newFiles.end(),
i.value()->fileName);
1777 if ((iterator == newFiles.end()) || (
i.value()->fileName < *iterator))
1778 toRemove.append(
i.value()->fileName);
1780 for (
int i = 0 ;
i < toRemove.size() ; ++
i )
1784#if defined(Q_OS_WIN)
1787 IShellItem *
item =
nullptr;
1789 HRESULT hr = SHCreateItemFromParsingName(
reinterpret_cast<const wchar_t *
>(native.
utf16()),
1790 nullptr, IID_IShellItem,
1791 reinterpret_cast<void **
>(&
item));
1794 LPWSTR
name =
nullptr;
1795 hr =
item->GetDisplayName(SIGDN_NORMALDISPLAY, &
name);
1799 CoTaskMemFree(
name);
1816#if QT_CONFIG(filesystemwatcher)
1821#if defined(Q_OS_WIN)
1846 if (vLocation >= 0 && !indexHidden)
1854 if (vLocation >= 0 && !indexHidden)
1878 for (
const auto &newFile : newFiles) {
1880 parentNode->
children.value(newFile)->isVisible =
true;
1896 if (vLocation == -1)
1918#if QT_CONFIG(filesystemwatcher)
1924 for (
const auto &update : updates) {
1929 if (!previouslyHere) {
1934 if (isCaseSensitive) {
1941 if (isCaseSensitive) {
1969 std::sort(rowsToUpdate.
begin(), rowsToUpdate.
end());
1972 for (
const QString &
value : std::as_const(rowsToUpdate)) {
1990 && visibleMin < parentNode->visibleChildren.size()
1992 && visibleMax >= 0) {
1994 const int lastColumn =
q->columnCount(parentIndex) - 1;
1998 lastColumn, parentIndex);
2009 if (newFiles.size() > 0) {
2013 if (newFiles.size() > 0 || (
sortColumn != 0 && rowsToUpdate.
size() > 0)) {
2031#if QT_CONFIG(filesystemwatcher) && defined(Q_OS_WIN)
2039 if (indexNode ==
nullptr)
2048 const int pathSize =
path.size();
2049 if (pathSize == watchedPath.size()) {
2050 return path.compare(watchedPath, caseSensitivity) == 0;
2051 }
else if (watchedPath.size() > pathSize) {
2052 return watchedPath.at(pathSize) == u
'/'
2053 && watchedPath.startsWith(
path, caseSensitivity);
2058 const QStringList &watchedFiles = fileInfoGatherer.watchedFiles();
2059 std::copy_if(watchedFiles.cbegin(), watchedFiles.cend(),
2062 const QStringList &watchedDirectories = fileInfoGatherer.watchedDirectories();
2063 std::copy_if(watchedDirectories.cbegin(), watchedDirectories.cend(),
2066 fileInfoGatherer.unwatchPaths(
result);
2084 qRegisterMetaType<QList<QPair<QString, QFileInfo>>>();
2085#if QT_CONFIG(filesystemwatcher)
2132 if ( (hideHidden && !(isDot || isDotDot) &&
node->
isHidden())
2140 || (hideDot && isDot)
2141 || (hideDotDot && isDotDot))
2154#if QT_CONFIG(regularexpression)
2155 if (nameFilters.isEmpty())
2164 return std::any_of(nameFiltersRegexps.begin(),
2165 nameFiltersRegexps.end(),
2166 matchesNodeFileName);
2174#if QT_CONFIG(regularexpression)
2175void QFileSystemModelPrivate::rebuildNameFilterRegexps()
2177 nameFiltersRegexps.clear();
2178 nameFiltersRegexps.reserve(nameFilters.size());
2180 const auto convertWildcardToRegexp = [cs](
const QString &nameFilter)
2184 std::transform(nameFilters.constBegin(),
2185 nameFilters.constEnd(),
2186 std::back_inserter(nameFiltersRegexps),
2187 convertWildcardToRegexp);
2193#include "moc_qfilesystemmodel.cpp"
@ DontUseCustomDirectoryIcons
virtual Q_INVOKABLE QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
virtual Q_INVOKABLE Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
QModelIndexList persistentIndexList() const
Q_INVOKABLE Qt::SortOrder order
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to)
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
void layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
virtual Q_INVOKABLE QModelIndex sibling(int row, int column, const QModelIndex &idx) const
Returns the sibling at row and column for the item at index, or an invalid QModelIndex if there is no...
virtual QHash< int, QByteArray > roleNames() const
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
QChar toUpper() const noexcept
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
void setNumericMode(bool on)
Enables numeric sorting mode when on is true.
void setCaseSensitivity(Qt::CaseSensitivity cs)
Sets the case-sensitivity of the collator to cs.
int compare(const QString &s1, const QString &s2) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
\inmodule QtCore\reentrant
static QString fromNativeSeparators(const QString &pathName)
QString path() const
Returns the path.
static QChar separator()
Returns the native directory separator: "/" under Unix and "\\" under Windows.
QString absolutePath() const
Returns the absolute path (a path that starts with "/" or with a drive specification),...
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
static QString toNativeSeparators(const QString &pathName)
static QString rootPath()
Returns the absolute path of the root directory.
bool rmdir(const QString &dirName) const
Removes the directory specified by dirName.
\inmodule QtCore \reentrant
bool isSymLink() const
Returns true if this object points to a symbolic link, shortcut, or alias; otherwise returns false.
QString absoluteFilePath() const
Returns an absolute path including the file name.
bool isFile() const
Returns true if this object points to a file or to a symbolic link to a file.
bool isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory.
QString canonicalFilePath() const
Returns the canonical path including the file name, i.e.
QString filePath() const
Returns the file name, including the path (which may be absolute or relative).
bool exists() const
Returns true if the file exists; otherwise returns false.
void populate(const QExtendedInformation &fileInfo)
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
bool passNameFilters(const QFileSystemNode *node) const
QHash< const QFileSystemNode *, bool > bypassFilters
QHash< QString, QString > resolvedSymLinks
QString name(const QModelIndex &index) const
QString filePath(const QModelIndex &index) const
QModelIndex index(const QString &path, int column=0)
QFileSystemNode * addNode(QFileSystemNode *parentNode, const QString &fileName, const QFileInfo &info)
QString type(const QModelIndex &index) const
void _q_directoryChanged(const QString &directory, const QStringList &list)
QString time(const QModelIndex &index) const
QString size(const QModelIndex &index) const
bool isHiddenByFilter(QFileSystemNode *indexNode, const QModelIndex &index) const
void _q_fileSystemChanged(const QString &path, const QList< QPair< QString, QFileInfo > > &)
bool disableRecursiveSort
QFileSystemModelPrivate()
QIcon icon(const QModelIndex &index) const
bool filtersAcceptsNode(const QFileSystemNode *node) const
QFileSystemNode * node(const QModelIndex &index) const
void sortChildren(int column, const QModelIndex &parent)
void removeVisibleFile(QFileSystemNode *parentNode, int visibleLocation)
void _q_performDelayedSort()
void removeNode(QFileSystemNode *parentNode, const QString &name)
int translateVisibleLocation(QFileSystemNode *parent, int row) const
static QString myComputer()
void _q_resolvedName(const QString &fileName, const QString &resolvedName)
void addVisibleFiles(QFileSystemNode *parentNode, const QStringList &newFiles)
~QFileSystemModelPrivate()
QString displayName(const QModelIndex &index) const
bool compareNodes(const QFileSystemModelPrivate::QFileSystemNode *l, const QFileSystemModelPrivate::QFileSystemNode *r) const
QFileSystemModelSorter(int column)
bool operator()(const QFileSystemModelPrivate::QFileSystemNode *l, const QFileSystemModelPrivate::QFileSystemNode *r) const
The QFileSystemModel class provides a data model for the local filesystem.
QModelIndex mkdir(const QModelIndex &parent, const QString &name)
Create a directory with the name in the parent model index.
QModelIndex setRootPath(const QString &path)
Sets the directory that is being watched by the model to newPath by installing a \l{QFileSystemWatche...
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
\reimp
QDir rootDirectory() const
The currently set directory.
void setOptions(Options options)
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
Handles the data supplied by a drag and drop operation that ended with the given action over the row ...
bool nameFilterDisables
Whether files that don't pass the name filter are hidden or disabled.
void setNameFilterDisables(bool enable)
@ DontUseCustomDirectoryIcons
void fileRenamed(const QString &path, const QString &oldName, const QString &newName)
This signal is emitted whenever a file with the oldName is successfully renamed to newName.
bool canFetchMore(const QModelIndex &parent) const override
\reimp
bool rmdir(const QModelIndex &index)
Removes the directory corresponding to the model item index in the file system model and {deletes the...
bool testOption(Option option) const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
\reimp
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
\reimp
void rootPathChanged(const QString &newPath)
This signal is emitted whenever the root path has been changed to a newPath.
QString rootPath() const
The currently set root path.
void setOption(Option option, bool on=true)
QString type(const QModelIndex &index) const
Returns the type of file index such as "Directory" or "JPEG file".
QFileInfo fileInfo(const QModelIndex &index) const
Returns the QFileInfo for the item stored in the model under the given index.
QFile::Permissions permissions(const QModelIndex &index) const
Returns the complete OR-ed together combination of QFile::Permission for the index.
QObject * parent() const
Returns a pointer to the parent object.
~QFileSystemModel()
Destroys this file system model.
QString filePath(const QModelIndex &index) const
Returns the path of the item stored in the model under the index given.
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override
\reimp
bool event(QEvent *event) override
\reimp
qint64 size(const QModelIndex &index) const
Returns the size in bytes of index.
QFileSystemModel(QObject *parent=nullptr)
Constructs a file system model with the given parent.
QStringList nameFilters() const
Returns a list of filters applied to the names in the model.
Qt::DropActions supportedDropActions() const override
\reimp
void setIconProvider(QAbstractFileIconProvider *provider)
Sets the provider of file icons for the directory model.
QVariant myComputer(int role=Qt::DisplayRole) const
Returns the data stored under the given role for the item "My Computer".
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
\reimp
void fetchMore(const QModelIndex &parent) override
\reimp
bool resolveSymlinks
Whether the directory model should resolve symbolic links.
void setReadOnly(bool enable)
QDateTime lastModified(const QModelIndex &index) const
Returns the date and time (in local time) when index was last modified.
void setNameFilters(const QStringList &filters)
Sets the name filters to apply against the existing files.
QStringList mimeTypes() const override
Returns a list of MIME types that can be used to describe a list of items in the model.
QHash< int, QByteArray > roleNames() const override
\reimp
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
\reimp
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
\reimp
QAbstractFileIconProvider * iconProvider() const
Returns the file icon provider for this directory model.
QDir::Filters filter() const
Returns the filter specified for the directory model.
void setResolveSymlinks(bool enable)
void setFilter(QDir::Filters filters)
Sets the directory model's filter to that specified by filters.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
QMimeData * mimeData(const QModelIndexList &indexes) const override
Returns an object that contains a serialized description of the specified indexes.
void timerEvent(QTimerEvent *event) override
\reimp
Options options
the various options that affect the model
bool remove(const QModelIndex &index)
Removes the model item index from the file system model and {deletes the corresponding file from the ...
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
int rowCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
bool isDir(const QModelIndex &index) const
Returns true if the model item index represents a directory; otherwise returns false.
bool link(const QString &newName)
Creates a link named linkName that points to the file currently specified by fileName().
bool copy(const QString &newName)
Copies the file named fileName() to newName.
bool remove()
Removes the file specified by fileName().
bool rename(const QString &newName)
Renames the file currently specified by fileName() to newName.
T value(const Key &key) const noexcept
bool isEmpty() const noexcept
Returns true if the hash contains no items; otherwise returns false.
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
@ Format_ARGB32_Premultiplied
qsizetype size() const noexcept
void removeAt(qsizetype i)
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
T value(qsizetype i) const
const_iterator constBegin() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator constEnd() const noexcept
QString formattedDataSize(qint64 bytes, int precision=2, DataSizeFormats format=DataSizeIecFormat) const
QString toString(qlonglong i) const
Returns a localized string representation of i.
static QLocale system()
Returns a QLocale object initialized to the system locale.
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
constexpr int column() const noexcept
Returns the column this model index refers to.
void * internalPointer() const noexcept
Returns a {void} {*} pointer used by the model to associate the index with the internal data structur...
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
const QObjectList & children() const
Returns a list of child objects.
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
\inmodule QtCore \reentrant
static QRegularExpression fromWildcard(QStringView pattern, Qt::CaseSensitivity cs=Qt::CaseInsensitive, WildcardConversionOptions options=DefaultWildcardConversion)
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
void chop(qsizetype n)
Removes n characters from the end of the string.
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString toLower() const &
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
QString & append(QChar c)
QString toUpper() const &
qsizetype length() const
Returns the number of characters in this string.
void setSingleShot(bool singleShot)
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
QSet< QString >::iterator it
Combined button and popup list for selecting options.
#define QByteArrayLiteral(str)
std::pair< T1, T2 > QPair
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLsizei GLsizei GLint * values
[15]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLbitfield GLuint64 timeout
[4]
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
GLenum GLenum GLsizei void * row
GLfixed GLfixed GLint GLint order
static QString absolutePath(const QString &path)
static QString canonicalPath(const QString &rootPath)
#define QT_CONFIG(feature)
static int compare(quint64 a, quint64 b)
QFileInfo info(fileName)
[8]
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]
bool contains(const AT &t) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent