21#include "moc_qgsvectortiledataitems.cpp"
23using namespace Qt::StringLiterals;
27QgsVectorTileRootItem::QgsVectorTileRootItem(
QgsDataItem *parent, QString name, QString path )
31 mIconName = u
"mIconVectorTileLayer.svg"_s;
35QVector<QgsDataItem *> QgsVectorTileRootItem::createChildren()
37 QVector<QgsDataItem *> connections;
38 const auto connectionList = QgsVectorTileProviderConnection::connectionList();
39 for (
const QString &connName : connectionList )
41 const QString uri = QgsVectorTileProviderConnection::encodedLayerUri( QgsVectorTileProviderConnection::connection( connName ) );
42 QgsDataItem *conn =
new QgsVectorTileLayerItem(
this, connName, mPath +
'/' + connName, uri );
43 connections.append( conn );
52QgsVectorTileLayerItem::QgsVectorTileLayerItem(
QgsDataItem *parent, QString name, QString path,
const QString &encodedUri )
53 :
QgsLayerItem( parent, name, path, encodedUri,
Qgis::BrowserLayerType::VectorTile, QString() )
56 mIconName = u
"mIconVectorTileLayer.svg"_s;
62QString QgsVectorTileDataItemProvider::name()
64 return u
"Vector Tiles"_s;
67QString QgsVectorTileDataItemProvider::dataProviderKey()
const
69 return u
"vectortile"_s;
80 return new QgsVectorTileRootItem( parentItem, QObject::tr(
"Vector Tiles" ), u
"vectortile:"_s );
Provides global constants and enumerations 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 browser item that represents a root group of connections from a single data provider.
Base class for all items in the model.
A browser item that represents a layer that can be opened with one of the providers.