16#include "moc_qgsvectortiledataitems.cpp"
21QgsVectorTileRootItem::QgsVectorTileRootItem(
QgsDataItem *parent, QString name, QString path )
25 mIconName = QStringLiteral(
"mIconVectorTileLayer.svg" );
29QVector<QgsDataItem *> QgsVectorTileRootItem::createChildren()
31 QVector<QgsDataItem *> connections;
32 const auto connectionList = QgsVectorTileProviderConnection::connectionList();
33 for (
const QString &connName : connectionList )
35 const QString uri = QgsVectorTileProviderConnection::encodedLayerUri( QgsVectorTileProviderConnection::connection( connName ) );
36 QgsDataItem *conn =
new QgsVectorTileLayerItem(
this, connName, mPath +
'/' + connName, uri );
37 connections.append( conn );
46QgsVectorTileLayerItem::QgsVectorTileLayerItem(
QgsDataItem *parent, QString name, QString path,
const QString &encodedUri )
47 :
QgsLayerItem( parent, name, path, encodedUri,
Qgis::BrowserLayerType::VectorTile, QString() )
50 mIconName = QStringLiteral(
"mIconVectorTileLayer.svg" );
56QString QgsVectorTileDataItemProvider::name()
58 return QStringLiteral(
"Vector Tiles" );
61QString QgsVectorTileDataItemProvider::dataProviderKey()
const
63 return QStringLiteral(
"vectortile" );
74 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.