17 #ifndef QGSDIRECTORYITEM_H
18 #define QGSDIRECTORYITEM_H
21 #include "qgis_core.h"
24 #include <QTreeWidget>
26 class 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();
209 void createOrDestroyFileSystemWatcher();
211 Qgis::BrowserDirectoryMonitoring mMonitoring =
Qgis::BrowserDirectoryMonitoring::Default;
212 bool mMonitored = true;
213 QFileSystemWatcher *mFileSystemWatcher =
nullptr;
214 bool mRefreshLater = false;
218 friend class TestQgsDataItem;
239 void mousePressEvent( QMouseEvent *event )
override;
242 void showHideColumn();
265 QIcon
icon()
override;
266 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 bool equal(const QgsDataItem *other)
Returns true if this item is equal to another item (by testing item type and path).
virtual QgsMimeDataUtils::UriList mimeUris() const
Returns mime URIs for the data item, most data providers will only return a single URI but some data ...
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.