16#ifndef QGSVECTORTILEBASICRENDERERWIDGET_H
17#define QGSVECTORTILEBASICRENDERERWIDGET_H
19#include "ui_qgsvectortilebasicrendererwidget.h"
25#include <QSortFilterProxyModel>
31class QgsVectorTileBasicRendererListModel;
35class QgsVectorTileBasicRendererProxyModel;
44class GUI_EXPORT QgsVectorTileBasicRendererWidget :
public QgsMapLayerConfigWidget,
private Ui::QgsVectorTileBasicRendererWidget
48 QgsVectorTileBasicRendererWidget( QgsVectorTileLayer *layer, QgsMapCanvas *canvas, QgsMessageBar *messageBar, QWidget *parent =
nullptr );
49 ~QgsVectorTileBasicRendererWidget()
override;
55 void apply()
override;
60 void editStyleAtIndex(
const QModelIndex &index );
63 void updateSymbolsFromWidget( QgsSymbolSelectorWidget *widget );
66 QPointer<QgsVectorTileLayer> mVTLayer;
67 std::unique_ptr<QgsVectorTileBasicRenderer> mRenderer;
68 QgsVectorTileBasicRendererListModel *mModel =
nullptr;
69 QgsVectorTileBasicRendererProxyModel *mProxyModel =
nullptr;
70 QgsMapCanvas *mMapCanvas =
nullptr;
71 QgsMessageBar *mMessageBar =
nullptr;
77class QgsVectorTileBasicRendererListModel :
public QAbstractListModel
83 MinZoom = Qt::UserRole + 1,
90 QgsVectorTileBasicRendererListModel( QgsVectorTileBasicRenderer *r, QObject *parent =
nullptr, QScreen *screen =
nullptr );
92 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
93 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
94 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
95 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
96 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
97 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
99 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
101 void insertStyle(
int row,
const QgsVectorTileBasicRendererStyle &style );
104 Qt::DropActions supportedDropActions()
const override;
105 QStringList mimeTypes()
const override;
106 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
107 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
110 QgsVectorTileBasicRenderer *mRenderer =
nullptr;
111 QPointer<QScreen> mScreen;
114class QgsVectorTileBasicRendererProxyModel :
public QSortFilterProxyModel
118 QgsVectorTileBasicRendererProxyModel( QgsVectorTileBasicRendererListModel *source, QObject *parent =
nullptr );
120 void setCurrentZoom(
int zoom );
121 void setFilterVisible(
bool enabled );
122 void setFilterString(
const QString &
string );
124 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
127 bool mFilterVisible =
false;
128 QString mFilterString;
129 int mCurrentZoom = -1;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Map canvas is a class for displaying all GIS data types on a canvas.
A bar for displaying non-blocking messages to the user.
Definition of map rendering of a subset of vector tile data.
The default vector tile renderer implementation.
Implements a map layer that is dedicated to rendering of vector tiles.