16#ifndef QGSVECTORTILEBASICLABELINGWIDGET_H
17#define QGSVECTORTILEBASICLABELINGWIDGET_H
19#include "ui_qgsvectortilebasiclabelingwidget.h"
25#include <QSortFilterProxyModel>
31class QgsVectorTileBasicLabelingListModel;
35class QgsVectorTileBasicLabelingProxyModel;
43class GUI_EXPORT QgsVectorTileBasicLabelingWidget :
public QgsMapLayerConfigWidget,
private Ui::QgsVectorTileBasicLabelingWidget
47 QgsVectorTileBasicLabelingWidget( QgsVectorTileLayer *layer, QgsMapCanvas *canvas, QgsMessageBar *messageBar, QWidget *parent =
nullptr );
48 ~QgsVectorTileBasicLabelingWidget()
override;
50 void setLayer( QgsVectorTileLayer *layer );
54 void apply()
override;
60 void editStyleAtIndex(
const QModelIndex &index );
63 void labelModeChanged();
64 void updateLabelingFromWidget();
65 void resyncToCurrentLayer();
68 QPointer<QgsVectorTileLayer> mVTLayer;
69 std::unique_ptr<QgsVectorTileBasicLabeling> mLabeling;
70 QgsVectorTileBasicLabelingListModel *mModel =
nullptr;
71 QgsVectorTileBasicLabelingProxyModel *mProxyModel =
nullptr;
72 QgsMapCanvas *mMapCanvas =
nullptr;
73 QgsMessageBar *mMessageBar =
nullptr;
92 QgsLabelingPanelWidget(
const QgsPalLayerSettings &labelSettings, QgsVectorLayer *vectorLayer, QgsMapCanvas *mapCanvas, QWidget *parent =
nullptr );
96 void setContext(
const QgsSymbolWidgetContext &context );
97 QgsPalLayerSettings labelSettings();
100 QgsLabelingGui *mLabelingGui =
nullptr;
106class QgsVectorTileBasicLabelingListModel :
public QAbstractListModel
112 MinZoom = Qt::UserRole + 1,
119 QgsVectorTileBasicLabelingListModel( QgsVectorTileBasicLabeling *r, QObject *parent =
nullptr );
121 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
122 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
123 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
124 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
125 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
126 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
128 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
130 void insertStyle(
int row,
const QgsVectorTileBasicLabelingStyle &style );
133 Qt::DropActions supportedDropActions()
const override;
134 QStringList mimeTypes()
const override;
135 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
136 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
139 QgsVectorTileBasicLabeling *mLabeling =
nullptr;
142class QgsVectorTileBasicLabelingProxyModel :
public QSortFilterProxyModel
146 QgsVectorTileBasicLabelingProxyModel( QgsVectorTileBasicLabelingListModel *source, QObject *parent =
nullptr );
148 void setCurrentZoom(
int zoom );
149 void setFilterVisible(
bool enabled );
150 void setFilterString(
const QString &
string );
152 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
155 bool mFilterVisible =
false;
156 QString mFilterString;
157 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.
Contains settings for how a map layer will be labeled.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Represents a vector layer which manages a vector based dataset.
Configuration of a single style within QgsVectorTileBasicLabeling.
Basic labeling configuration for vector tile layers.
Implements a map layer that is dedicated to rendering of vector tiles.