QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
24 #include <QRegularExpression>
29 const QString &providerKey )
30 :
QgsDataItem(
Qgis::BrowserItemType::Collection, parent, name, path, providerKey )
33 mIconName = QStringLiteral(
"/mIconDbSchema.svg" );
45 QgsDebugMsgLevel( QStringLiteral(
"delete child = 0x%0" ).arg(
static_cast<qlonglong
>( i ), 8, 16, QLatin1Char(
'0' ) ), 2 );
58 return fillColor.isValid() || strokeColor.isValid()
65 return fillColor.isValid() || strokeColor.isValid()
80 const QString connectionName {
name() };
85 if ( md->findConnection( connectionName ) )
93 const QString databaseFilePath {
path().remove( QRegularExpression( R
"re([\aZ]{2,}://)re" ) ) };
95 if ( QFile::exists( databaseFilePath ) )
110 return fillColor.isValid() || strokeColor.isValid()
static QIcon homeDirIcon(const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Shared home directory icon.
static QIcon iconDir(const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Returns the standard browser directory icon.
#define QgsDebugMsgLevel(str, level)
static QIcon iconDataCollection()
Returns the standard browser data collection icon.
~QgsDataCollectionItem() override
QString name() const
Returns the name of the item (the displayed text for the item).
Qgis::BrowserItemCapabilities mCapabilities
QgsAbstractDatabaseProviderConnection * databaseConnection() const override
For data items that represent a DB connection or one of its children, this method returns a connectio...
static QgsDataItemProviderRegistry * dataItemProviderRegistry()
Returns the application's data item provider registry, which keeps a list of data item providers that...
QgsDataCollectionItem(QgsDataItem *parent, const QString &name, const QString &path=QString(), const QString &providerKey=QString())
Constructor for QgsDataCollectionItem, with the specified parent item.
static QIcon openDirIcon(const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Shared open directory icon.
QgsProviderMetadata * providerMetadata(const QString &providerKey) const
Returns metadata of the provider or nullptr if not found.
Custom exception class for provider connection related exceptions.
QVector< QgsDataItem * > mChildren
QString dataProviderKey(const QString &dataItemProviderName)
Returns the (possibly blank) data provider key for a given data item provider name.
The Qgis class provides global constants for use throughout the application.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
QString providerKey() const
Returns the provider key that created this item (e.g.
Base class for all items in the model.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
@ Fertile
Can create children. Even items without this capability may have children, but cannot create them,...