17#ifndef QGSDIRECTORYITEM_H
18#define QGSDIRECTORYITEM_H
26class QFileSystemWatcher;
73 SIP_PYOBJECT __repr__();
75 QString str = QStringLiteral(
"<QgsDirectoryItem: %1 - %2>" ).arg( sipCpp->dirPath(), sipCpp->path() );
76 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
86 QString
dirPath()
const {
return mDirPath; }
89 QIcon
icon()
override;
99 QColor iconColor()
const;
112 void setIconColor(
const QColor &color );
121 static void setCustomColor(
const QString &directory,
const QColor &color );
124 bool hasDragEnabled()
const override {
return true; }
128 static bool hiddenPath(
const QString &path );
161 static bool pathShouldByMonitoredByDefault(
const QString &path );
196 void reevaluateMonitoring()
SIP_SKIP;
199 void childrenCreated() override;
200 void directoryChanged();
208 void init( const QString &dirName );
210 void createOrDestroyFileSystemWatcher();
212 Qgis::BrowserDirectoryMonitoring mMonitoring =
Qgis::BrowserDirectoryMonitoring::Default;
213 bool mMonitored = true;
214 QFileSystemWatcher *mFileSystemWatcher =
nullptr;
215 bool mRefreshLater = false;
220 bool mIsSymLink = false;
222 friend class TestQgsDataItem;
243 void mousePressEvent( QMouseEvent *event )
override;
246 void showHideColumn();
268 QIcon
icon()
override;
269 QVariant
sortKey()
const override;
The Qgis class provides global constants for use throughout the application.
BrowserItemState
Browser item states.
BrowserDirectoryMonitoring
Browser directory item monitoring switches.
A Collection: logical collection of layers or subcollections, e.g.
Base class for all items in the model.
virtual QVariant sortKey() const
Returns the sorting key for the item.
virtual QVector< QgsDataItem * > createChildren()
Create children.
virtual void setState(Qgis::BrowserItemState state)
Set item state.
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 ...
virtual bool equal(const QgsDataItem *other)
Returns true if this item is equal to another item (by testing item type and path).
A directory: contains subdirectories and layers.
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.
QList< QgsMimeDataUtils::Uri > UriList
A directory item showing the current project directory.