18#ifndef QGSSTACKEDDIAGRAMPROPERTIES_H
19#define QGSSTACKEDDIAGRAMPROPERTIES_H
24#include "ui_qgsstackeddiagrampropertiesbase.h"
31#include <QDialogButtonBox>
57 Qt::ItemFlags
flags(
const QModelIndex &index )
const override;
58 QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
59 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
60 int rowCount(
const QModelIndex & = QModelIndex() )
const override;
61 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
64 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
65 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
70 QMimeData *
mimeData(
const QModelIndexList &indexes )
const override;
71 bool dropMimeData(
const QMimeData *
data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
119 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
159 void addSubDiagramRenderer();
170 void editSubDiagramRenderer();
175 void editSubDiagramRenderer(
const QModelIndex &index );
180 void removeSubDiagramRenderer();
194 bool couldBeFirstSubDiagram(
const QModelIndex &index )
const;
198 void liveUpdateSubDiagramFromPanel();
268 std::unique_ptr<QgsDiagramRenderer> mRenderer;
270 QDialogButtonBox *buttonBox =
nullptr;
Stores the settings for rendering of all diagrams for a layer.
A widget which configures diagrams for a vector layer.
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
Map canvas is a class for displaying all GIS data types on a canvas.
QgsProxyStyle(QWidget *parent)
Constructor for QgsProxyStyle.
QgsStackedDiagramPropertiesDialog(QgsVectorLayer *layer, QWidget *parent=nullptr, QgsMapCanvas *mapCanvas=nullptr)
Constructor for QgsStackedDiagramPropertiesDialog.
QgsDiagramLayerSettings diagramLayerSettings() const
Gets diagram layer settings built from the diagram properties widget.
void setAllowedToEditDiagramLayerSettings(bool allowed) const
Delegates to the main widget to set whether the widget should show diagram layer settings to be edite...
void syncToRenderer(const QgsDiagramRenderer *dr) const
Delegates to the diagram properties widget to sync with the given renderer.
void syncToSettings(const QgsDiagramLayerSettings *dls) const
Delegates to the diagram properties widget to sync with the given diagram layer settings.
bool isAllowedToEditDiagramLayerSettings() const
Returns whether the main widget is allowed to edit diagram layer settings.
void accept() override
Applies changes from the widget to the internal renderer and diagram layer settings.
QgsDiagramRenderer * renderer()
Gets a renderer object built from the diagram properties widget.
Model for sub diagrams in a stacked diagram view.
Qt::DropActions supportedDropActions() const override
QMimeData * mimeData(const QModelIndexList &indexes) const override
void updateSubDiagram(const QModelIndex &index, QgsDiagramRenderer *dr)
Replaces the diagram located at index by dr. Takes ownership.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
void insertSubDiagram(const int index, QgsDiagramRenderer *newSubDiagram)
Inserts a new diagram at the specified position. Takes ownership.
QStringList mimeTypes() const override
QList< QgsDiagramRenderer * > mRenderers
QgsDiagramLayerSettings mDiagramLayerSettings
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QgsDiagramRenderer * subDiagramForIndex(const QModelIndex &index) const
Returns the diagram renderer at the specified index. Does not transfer ownership.
void updateDiagramLayerSettings(QgsDiagramLayerSettings dls)
Sets the diagram layer settings for the model.
Qt::ItemFlags flags(const QModelIndex &index) const override
QgsDiagramLayerSettings diagramLayerSettings() const
Returns the diagram layer settings from the model.
QList< QgsDiagramRenderer * > subRenderers() const
Returns the list of diagram renderers from the model. Does not transfer ownership.
int columnCount(const QModelIndex &=QModelIndex()) const override
void subDiagramsMoved()
Informs views that subdiagrams were moved in the model.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
QgsStackedDiagramPropertiesModel(QObject *parent=nullptr)
constructor
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
int rowCount(const QModelIndex &=QModelIndex()) const override
void clearCurrentIndex()
Clears current item from the view.
void syncToLayer()
Updates the widget to reflect the layer's current diagram settings.
void auxiliaryFieldCreated()
QgsStackedDiagramProperties(QgsVectorLayer *layer, QWidget *parent, QgsMapCanvas *canvas)
QgsStackedDiagramsViewStyle(QWidget *parent)
Constructor for QgsStackedDiagramsViewStyle.
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=nullptr) const override
Represents a vector layer which manages a vector based dataset.