Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QFileSystemModelPrivate Class Reference

#include <qfilesystemmodel_p.h>

Inheritance diagram for QFileSystemModelPrivate:
Collaboration diagram for QFileSystemModelPrivate:

Classes

struct  Fetching
class  QFileSystemNode

Public Types

enum  {
  NameColumn , SizeColumn , TypeColumn , TimeColumn ,
  NumColumns = 4
}
Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>

Public Member Functions

 QFileSystemModelPrivate ()
 ~QFileSystemModelPrivate ()
void init ()
bool isHiddenByFilter (QFileSystemNode *indexNode, const QModelIndex &index) const
QFileSystemNodenode (const QModelIndex &index) const
QFileSystemNodenode (const QString &path, bool fetch=true) const
QModelIndex index (const QString &path, int column=0)
QModelIndex index (const QFileSystemNode *node, int column=0) const
bool filtersAcceptsNode (const QFileSystemNode *node) const
bool passNameFilters (const QFileSystemNode *node) const
void removeNode (QFileSystemNode *parentNode, const QString &name)
QFileSystemNodeaddNode (QFileSystemNode *parentNode, const QString &fileName, const QFileInfo &info)
void addVisibleFiles (QFileSystemNode *parentNode, const QStringList &newFiles)
void removeVisibleFile (QFileSystemNode *parentNode, int visibleLocation)
void sortChildren (int column, const QModelIndex &parent)
int translateVisibleLocation (QFileSystemNode *parent, int row) const
void delayedSort ()
QIcon icon (const QModelIndex &index) const
QString name (const QModelIndex &index) const
QString displayName (const QModelIndex &index) const
QString filePath (const QModelIndex &index) const
QString size (const QModelIndex &index) const
QString type (const QModelIndex &index) const
QString time (const QModelIndex &index) const
void directoryChanged (const QString &directory, const QStringList &list)
void performDelayedSort ()
void fileSystemChanged (const QString &path, const QList< std::pair< QString, QFileInfo > > &)
void resolvedName (const QString &fileName, const QString &resolvedName)
Public Member Functions inherited from QAbstractItemModelPrivate
 QAbstractItemModelPrivate ()
 ~QAbstractItemModelPrivate ()
void removePersistentIndexData (QPersistentModelIndexData *data)
void movePersistentIndexes (const QList< QPersistentModelIndexData * > &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation)
void rowsAboutToBeInserted (const QModelIndex &parent, int first, int last)
void rowsInserted (const QModelIndex &parent, int first, int last)
void rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
void rowsRemoved (const QModelIndex &parent, int first, int last)
void columnsAboutToBeInserted (const QModelIndex &parent, int first, int last)
void columnsInserted (const QModelIndex &parent, int first, int last)
void columnsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
void columnsRemoved (const QModelIndex &parent, int first, int last)
void itemsAboutToBeMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation)
void itemsMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
bool allowMove (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
 Returns whether a move operation is valid.
virtual void executePendingOperations () const
QModelIndex createIndex (int row, int column, void *data=nullptr) const
QModelIndex createIndex (int row, int column, int id) const
bool indexValid (const QModelIndex &index) const
void invalidatePersistentIndexes ()
void invalidatePersistentIndex (const QModelIndex &index)
Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
void setObjectNameWithoutBindings (const QString &name)
 QObjectPrivate (decltype(QObjectPrivateVersion) version=QObjectPrivateVersion)
virtual ~QObjectPrivate ()
void deleteChildren ()
void clearBindingStorage ()
void setParent_helper (QObject *)
void moveToThread_helper ()
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
QObjectList receiverList (const char *signal) const
void ensureConnectionData ()
void addConnection (int signal, Connection *c)
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
bool maybeSignalConnected (uint signalIndex) const
bool isDeclarativeSignalConnected (uint signalIdx) const
void connectNotify (const QMetaMethod &signal)
void disconnectNotify (const QMetaMethod &signal)
void reinitBindingStorageAfterThreadMove ()
virtual std::string flagsForDumping () const
virtual void writeToDebugStream (QDebug &) const
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
Public Member Functions inherited from QObjectData
 QObjectData ()=default
virtual ~QObjectData ()=0
const QMetaObjectdynamicMetaObject () const

Static Public Member Functions

static QString myComputer ()
static QString size (qint64 bytes)
Static Public Member Functions inherited from QAbstractItemModelPrivate
static const QAbstractItemModelPrivateget (const QAbstractItemModel *model)
static QAbstractItemModelstaticEmptyModel ()
static bool variantLessThan (const QVariant &v1, const QVariant &v2)
static const QHash< int, QByteArray > & defaultRoleNames ()
static bool isVariantLessThan (const QVariant &left, const QVariant &right, Qt::CaseSensitivity cs=Qt::CaseSensitive, bool isLocaleAware=false)
Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
static QObjectPrivateget (QObject *o)
static const QObjectPrivateget (const QObject *o)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static bool disconnect (const QObject *sender, int signal_index, void **slot)
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)

Public Attributes

QDir rootDir
QTimer delayedSortTimer
QHash< const QFileSystemNode *, bool > bypassFilters
QHash< QString, QStringresolvedSymLinks
QFileSystemNode root
QList< FetchingtoFetch
QBasicTimer fetchingTimer
QDir::Filters filters = QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs
int sortColumn = 0
Qt::SortOrder sortOrder = Qt::AscendingOrder
bool forceSort = true
bool readOnly = true
bool setRootPath = false
bool nameFilterDisables = true
bool disableRecursiveSort = false
Public Attributes inherited from QAbstractItemModelPrivate
QStack< Changechanges
struct QAbstractItemModelPrivate::Persistent persistent
bool resetting = false
Public Attributes inherited from QObjectPrivate
ExtraDataextraData
QAtomicPointer< QThreadDatathreadData
QAtomicPointer< ConnectionDataconnections
union { 
   QObject *   currentChildBeingDeleted 
   QAbstractDeclarativeData *   declarativeData 
}; 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
Public Attributes inherited from QObjectData
QObjectq_ptr
QObjectparent
QObjectList children
uint isWidget: 1
uint blockSig: 1
uint wasDeleted: 1
uint isDeletingChildren: 1
uint sendChildEvents: 1
uint receiveChildEvents: 1
uint isWindow: 1
uint deleteLaterCalled: 1
uint isQuickItem: 1
uint willBeWidget: 1
uint wasWidget: 1
uint receiveParentEvents: 1
uint unused: 20
QAtomicInt postedEvents
QDynamicMetaObjectDatametaObject
QBindingStorage bindingStorage

Detailed Description

Definition at line 61 of file qfilesystemmodel_p.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NameColumn 
SizeColumn 
TypeColumn 
TimeColumn 
NumColumns 

Definition at line 66 of file qfilesystemmodel_p.h.

Constructor & Destructor Documentation

◆ QFileSystemModelPrivate()

QFileSystemModelPrivate::QFileSystemModelPrivate ( )

Definition at line 2116 of file qfilesystemmodel.cpp.

◆ ~QFileSystemModelPrivate()

QFileSystemModelPrivate::~QFileSystemModelPrivate ( )

Definition at line 2123 of file qfilesystemmodel.cpp.

Member Function Documentation

◆ addNode()

QFileSystemModelPrivate::QFileSystemNode * QFileSystemModelPrivate::addNode ( QFileSystemNode * parentNode,
const QString & fileName,
const QFileInfo & info )

Adds a new file to the children of parentNode

WARNING* this will change the count of children

Definition at line 1852 of file qfilesystemmodel.cpp.

◆ addVisibleFiles()

void QFileSystemModelPrivate::addVisibleFiles ( QFileSystemNode * parentNode,
const QStringList & newFiles )

File at parentNode->children(itemLocation) was not visible before, but now should be and emit signals if necessary.

WARNING* this will change the visible count

Definition at line 1906 of file qfilesystemmodel.cpp.

◆ delayedSort()

void QFileSystemModelPrivate::delayedSort ( )
inline

Definition at line 246 of file qfilesystemmodel_p.h.

◆ directoryChanged()

void QFileSystemModelPrivate::directoryChanged ( const QString & directory,
const QStringList & files )

Performed quick listing and see if any files have been added or removed, then fetch more information on visible files.

Definition at line 1807 of file qfilesystemmodel.cpp.

◆ displayName()

QString QFileSystemModelPrivate::displayName ( const QModelIndex & index) const

Definition at line 855 of file qfilesystemmodel.cpp.

◆ filePath()

QString QFileSystemModelPrivate::filePath ( const QModelIndex & index) const

Definition at line 1421 of file qfilesystemmodel.cpp.

◆ fileSystemChanged()

void QFileSystemModelPrivate::fileSystemChanged ( const QString & path,
const QList< std::pair< QString, QFileInfo > > & updates )

The thread has received new information about files, update and emit dataChanged if it has actually changed.

Definition at line 1955 of file qfilesystemmodel.cpp.

◆ filtersAcceptsNode()

bool QFileSystemModelPrivate::filtersAcceptsNode ( const QFileSystemNode * node) const

Returns false if node doesn't pass the filters otherwise true

QDir::Modified is not supported QDir::Drives is not supported

Definition at line 2171 of file qfilesystemmodel.cpp.

◆ icon()

QIcon QFileSystemModelPrivate::icon ( const QModelIndex & index) const

Definition at line 868 of file qfilesystemmodel.cpp.

◆ index() [1/2]

QModelIndex QFileSystemModelPrivate::index ( const QFileSystemNode * node,
int column = 0 ) const

Definition at line 616 of file qfilesystemmodel.cpp.

◆ index() [2/2]

QModelIndex QFileSystemModelPrivate::index ( const QString & path,
int column = 0 )
inline

Definition at line 212 of file qfilesystemmodel_p.h.

◆ init()

void QFileSystemModelPrivate::init ( )

Definition at line 2142 of file qfilesystemmodel.cpp.

◆ isHiddenByFilter()

bool QFileSystemModelPrivate::isHiddenByFilter ( QFileSystemNode * indexNode,
const QModelIndex & index ) const
inline

Definition at line 206 of file qfilesystemmodel_p.h.

◆ myComputer()

QString QFileSystemModelPrivate::myComputer ( )
inlinestatic

Definition at line 234 of file qfilesystemmodel_p.h.

◆ name()

QString QFileSystemModelPrivate::name ( const QModelIndex & index) const

Definition at line 836 of file qfilesystemmodel.cpp.

◆ node() [1/2]

QFileSystemModelPrivate::QFileSystemNode * QFileSystemModelPrivate::node ( const QModelIndex & index) const

Return the QFileSystemNode that goes to index.

Definition at line 272 of file qfilesystemmodel.cpp.

◆ node() [2/2]

QFileSystemModelPrivate::QFileSystemNode * QFileSystemModelPrivate::node ( const QString & path,
bool fetch = true ) const

Given a path return the matching QFileSystemNode or &root if invalid

Definition at line 339 of file qfilesystemmodel.cpp.

◆ passNameFilters()

bool QFileSystemModelPrivate::passNameFilters ( const QFileSystemNode * node) const

Definition at line 2222 of file qfilesystemmodel.cpp.

◆ performDelayedSort()

void QFileSystemModelPrivate::performDelayedSort ( )

Definition at line 1030 of file qfilesystemmodel.cpp.

◆ removeNode()

void QFileSystemModelPrivate::removeNode ( QFileSystemModelPrivate::QFileSystemNode * parentNode,
const QString & name )

File at parentNode->children(itemLocation) has been removed, remove from the lists and emit signals if necessary

WARNING* this will change the count of children and could change visibleChildren

Definition at line 1879 of file qfilesystemmodel.cpp.

◆ removeVisibleFile()

void QFileSystemModelPrivate::removeVisibleFile ( QFileSystemNode * parentNode,
int vLocation )

File was visible before, but now should NOT be

WARNING* this will change the visible count

Definition at line 1933 of file qfilesystemmodel.cpp.

◆ resolvedName()

void QFileSystemModelPrivate::resolvedName ( const QString & fileName,
const QString & resolvedName )

Definition at line 2071 of file qfilesystemmodel.cpp.

◆ size() [1/2]

QString QFileSystemModelPrivate::size ( const QModelIndex & index) const

Definition at line 784 of file qfilesystemmodel.cpp.

◆ size() [2/2]

QString QFileSystemModelPrivate::size ( qint64 bytes)
static

Definition at line 803 of file qfilesystemmodel.cpp.

◆ sortChildren()

void QFileSystemModelPrivate::sortChildren ( int column,
const QModelIndex & parent )

Definition at line 1117 of file qfilesystemmodel.cpp.

◆ time()

QString QFileSystemModelPrivate::time ( const QModelIndex & index) const

Definition at line 811 of file qfilesystemmodel.cpp.

◆ translateVisibleLocation()

int QFileSystemModelPrivate::translateVisibleLocation ( QFileSystemNode * parent,
int row ) const
inline

Definition at line 222 of file qfilesystemmodel_p.h.

◆ type()

QString QFileSystemModelPrivate::type ( const QModelIndex & index) const

Definition at line 826 of file qfilesystemmodel.cpp.

Member Data Documentation

◆ bypassFilters

QHash<const QFileSystemNode*, bool> QFileSystemModelPrivate::bypassFilters

Definition at line 274 of file qfilesystemmodel_p.h.

◆ delayedSortTimer

QTimer QFileSystemModelPrivate::delayedSortTimer

Definition at line 273 of file qfilesystemmodel_p.h.

◆ disableRecursiveSort

bool QFileSystemModelPrivate::disableRecursiveSort = false

Definition at line 302 of file qfilesystemmodel_p.h.

◆ fetchingTimer

QBasicTimer QFileSystemModelPrivate::fetchingTimer

Definition at line 291 of file qfilesystemmodel_p.h.

◆ filters

QDir::Filters QFileSystemModelPrivate::filters = QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs

Definition at line 293 of file qfilesystemmodel_p.h.

◆ forceSort

bool QFileSystemModelPrivate::forceSort = true

Definition at line 296 of file qfilesystemmodel_p.h.

◆ nameFilterDisables

bool QFileSystemModelPrivate::nameFilterDisables = true

Definition at line 299 of file qfilesystemmodel_p.h.

◆ readOnly

bool QFileSystemModelPrivate::readOnly = true

Definition at line 297 of file qfilesystemmodel_p.h.

◆ resolvedSymLinks

QHash<QString, QString> QFileSystemModelPrivate::resolvedSymLinks

Definition at line 280 of file qfilesystemmodel_p.h.

◆ root

QFileSystemNode QFileSystemModelPrivate::root

Definition at line 282 of file qfilesystemmodel_p.h.

◆ rootDir

QDir QFileSystemModelPrivate::rootDir

Definition at line 265 of file qfilesystemmodel_p.h.

◆ setRootPath

bool QFileSystemModelPrivate::setRootPath = false

Definition at line 298 of file qfilesystemmodel_p.h.

◆ sortColumn

int QFileSystemModelPrivate::sortColumn = 0

Definition at line 294 of file qfilesystemmodel_p.h.

◆ sortOrder

Qt::SortOrder QFileSystemModelPrivate::sortOrder = Qt::AscendingOrder

Definition at line 295 of file qfilesystemmodel_p.h.

◆ toFetch

QList<Fetching> QFileSystemModelPrivate::toFetch

Definition at line 289 of file qfilesystemmodel_p.h.


The documentation for this class was generated from the following files: