20QgsVectorTileRootItem::QgsVectorTileRootItem(
QgsDataItem *parent, QString name, QString path )
24 mIconName = QStringLiteral(
"mIconVectorTileLayer.svg" );
28QVector<QgsDataItem *> QgsVectorTileRootItem::createChildren()
30 QVector<QgsDataItem *> connections;
31 const auto connectionList = QgsVectorTileProviderConnection::connectionList();
32 for (
const QString &connName : connectionList )
34 const QString uri = QgsVectorTileProviderConnection::encodedLayerUri( QgsVectorTileProviderConnection::connection( connName ) );
35 QgsDataItem *conn =
new QgsVectorTileLayerItem(
this, connName, mPath +
'/' + connName, uri );
36 connections.append( conn );
45QgsVectorTileLayerItem::QgsVectorTileLayerItem(
QgsDataItem *parent, QString name, QString path,
const QString &encodedUri )
46 :
QgsLayerItem( parent, name, path, encodedUri,
Qgis::BrowserLayerType::VectorTile, QString() )
49 mIconName = QStringLiteral(
"mIconVectorTileLayer.svg" );
55QString QgsVectorTileDataItemProvider::name()
57 return QStringLiteral(
"Vector Tiles" );
60QString QgsVectorTileDataItemProvider::dataProviderKey()
const
62 return QStringLiteral(
"vectortile" );
73 return new QgsVectorTileRootItem( parentItem, QObject::tr(
"Vector Tiles" ), QStringLiteral(
"vectortile:" ) );
The Qgis class provides global constants for use throughout the application.
@ NetworkSources
Network/internet source.
@ Populated
Children created.
@ Fast
CreateChildren() is fast enough to be run in main thread when refreshing items, most root items (wms,...
QFlags< DataItemProviderCapability > DataItemProviderCapabilities
Capabilities for data item providers.
A Collection that represents a root group of connections from a single data provider.
Base class for all items in the model.
Item that represents a layer that can be opened with one of the providers.