17#ifndef QGSDIRECTORYITEM_H
18#define QGSDIRECTORYITEM_H
27class QFileSystemWatcher;
74 SIP_PYOBJECT __repr__();
76 QString str = QStringLiteral(
"<QgsDirectoryItem: %1 - %2>" ).arg( sipCpp->dirPath(), sipCpp->path() );
77 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
90 QIcon
icon()
override;
100 QColor iconColor()
const;
113 void setIconColor(
const QColor &color );
122 static void setCustomColor(
const QString &directory,
const QColor &color );
132 static bool hiddenPath(
const QString &path );
165 static bool pathShouldByMonitoredByDefault(
const QString &path );
200 void reevaluateMonitoring()
SIP_SKIP;
203 void childrenCreated() override;
204 void directoryChanged();
212 void init( const QString &dirName );
214 void createOrDestroyFileSystemWatcher();
216 Qgis::BrowserDirectoryMonitoring mMonitoring =
Qgis::BrowserDirectoryMonitoring::Default;
217 bool mMonitored = true;
218 QFileSystemWatcher *mFileSystemWatcher =
nullptr;
219 bool mRefreshLater = false;
224 bool mIsSymLink = false;
272 QIcon
icon()
override;
273 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.