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() );
94 QIcon
icon()
override;
104 QColor iconColor()
const;
117 void setIconColor(
const QColor &color );
126 static void setCustomColor(
const QString &directory,
const QColor &color );
136 static bool hiddenPath(
const QString &path );
169 static bool pathShouldByMonitoredByDefault(
const QString &path );
204 void reevaluateMonitoring()
SIP_SKIP;
207 void childrenCreated() override;
208 void directoryChanged();
214 void init( const QString &dirName );
216 void createOrDestroyFileSystemWatcher();
218 Qgis::BrowserDirectoryMonitoring mMonitoring =
Qgis::BrowserDirectoryMonitoring::Default;
219 bool mMonitored = true;
220 QFileSystemWatcher *mFileSystemWatcher =
nullptr;
221 bool mRefreshLater = false;
226 bool mIsSymLink = false;
273 QIcon
icon()
override;
274 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.