17#ifndef QGSDIRECTORYITEM_H
18#define QGSDIRECTORYITEM_H
28using namespace Qt::StringLiterals;
30class QFileSystemWatcher;
77 SIP_PYOBJECT __repr__();
79 QString str = u
"<QgsDirectoryItem: %1 - %2>"_s.arg( sipCpp->dirPath(), sipCpp->path() );
80 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
93 QIcon
icon()
override;
103 QColor iconColor()
const;
116 void setIconColor(
const QColor &color );
125 static void setCustomColor(
const QString &directory,
const QColor &color );
135 static bool hiddenPath(
const QString &path );
168 static bool pathShouldByMonitoredByDefault(
const QString &path );
203 void reevaluateMonitoring()
SIP_SKIP;
206 void childrenCreated() override;
207 void directoryChanged();
215 void init( const QString &dirName );
217 void createOrDestroyFileSystemWatcher();
219 Qgis::BrowserDirectoryMonitoring mMonitoring =
Qgis::BrowserDirectoryMonitoring::Default;
220 bool mMonitored = true;
221 QFileSystemWatcher *mFileSystemWatcher =
nullptr;
222 bool mRefreshLater = false;
227 bool mIsSymLink = false;
275 QIcon
icon()
override;
276 QVariant
sortKey()
const override;
Provides global constants and enumerations for use throughout the application.
BrowserItemState
Browser item states.
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
QgsDataCollectionItem(QgsDataItem *parent, const QString &name, const QString &path=QString(), const QString &providerKey=QString())
Constructor for QgsDataCollectionItem, with the specified parent item.
Base class for all items in the model.
virtual QVariant sortKey() const
Returns the sorting key for the item.
QgsDataItem(Qgis::BrowserItemType type, QgsDataItem *parent, const QString &name, const QString &path, const QString &providerKey=QString())
Constructor for QgsDataItem, with the specified parent item.
virtual QVector< QgsDataItem * > createChildren()
Create children.
Qgis::BrowserItemState state() const
QString name() const
Returns the name of the item (the displayed text for the item).
virtual void setState(Qgis::BrowserItemState state)
Set item state.
QgsDataItem * parent() const
Gets item parent.
virtual Q_DECL_DEPRECATED QWidget * paramWidget()
Returns source widget from data item for QgsBrowserPropertiesWidget.
virtual QgsMimeDataUtils::UriList mimeUris() const
Returns mime URIs for the data item, most data providers will only return a single URI but some data ...
QString providerKey() const
Returns the provider key that created this item (e.g.
virtual bool equal(const QgsDataItem *other)
Returns true if this item is equal to another item (by testing item type and path).
friend class TestQgsDataItem
bool isMonitored() const
Returns true if the directory is currently being monitored for changes and the item auto-refreshed wh...
QString dirPath() const
Returns the full path to the directory the item represents.
QgsDirectoryItem(QgsDataItem *parent, const QString &name, const QString &path)
Constructor for QgsDirectoryItem, with the specified parent item.
bool hasDragEnabled() const override
Returns true if the item may be dragged.
QList< QgsMimeDataUtils::Uri > UriList
QgsProjectHomeItem(QgsDataItem *parent, const QString &name, const QString &dirPath, const QString &path)
Constructor for QgsProjectHomeItem.