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 );
127 bool hasDragEnabled()
const override {
return true; }
131 static bool hiddenPath(
const QString &path );
164 static bool pathShouldByMonitoredByDefault(
const QString &path );
199 void reevaluateMonitoring()
SIP_SKIP;
202 void childrenCreated() override;
203 void directoryChanged();
211 void init( const QString &dirName );
213 void createOrDestroyFileSystemWatcher();
215 Qgis::BrowserDirectoryMonitoring mMonitoring =
Qgis::BrowserDirectoryMonitoring::Default;
216 bool mMonitored = true;
217 QFileSystemWatcher *mFileSystemWatcher =
nullptr;
218 bool mRefreshLater = false;
223 bool mIsSymLink = false;
225 friend class TestQgsDataItem;
246 void mousePressEvent( QMouseEvent *event )
override;
249 void showHideColumn();
271 QIcon
icon()
override;
272 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.