17 #include "qgssettings.h"
23 QgsVectorTileRootItem::QgsVectorTileRootItem(
QgsDataItem *parent, QString name, QString path )
27 mIconName = QStringLiteral(
"mIconVectorTileLayer.svg" );
31 QVector<QgsDataItem *> QgsVectorTileRootItem::createChildren()
33 QVector<QgsDataItem *> connections;
34 const auto connectionList = QgsVectorTileProviderConnection::connectionList();
35 for (
const QString &connName : connectionList )
37 QString uri = QgsVectorTileProviderConnection::encodedLayerUri( QgsVectorTileProviderConnection::connection( connName ) );
38 QgsDataItem *conn =
new QgsVectorTileLayerItem(
this, connName, mPath +
'/' + connName, uri );
39 connections.append( conn );
48 QgsVectorTileLayerItem::QgsVectorTileLayerItem(
QgsDataItem *parent, QString name, QString path,
const QString &encodedUri )
49 :
QgsLayerItem( parent, name, path, encodedUri,
Qgis::BrowserLayerType::VectorTile, QString() )
52 mIconName = QStringLiteral(
"mIconVectorTileLayer.svg" );
58 QString QgsVectorTileDataItemProvider::name()
60 return QStringLiteral(
"Vector Tiles" );
63 QString QgsVectorTileDataItemProvider::dataProviderKey()
const
65 return QStringLiteral(
"vectortile" );
68 int QgsVectorTileDataItemProvider::capabilities()
const
76 return new QgsVectorTileRootItem( parentItem, QStringLiteral(
"Vector Tiles" ), QStringLiteral(
"vectortile:" ) );
The Qgis class provides global constants for use throughout the application.
@ Populated
Children created.
@ Fast
CreateChildren() is fast enough to be run in main thread when refreshing items, most root items (wms,...
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.