QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
qgssymbollevelsdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssymbollevelsdialog.h
3 ---------------------
4 begin : November 2009
5 copyright : (C) 2009 by Martin Dobias
6 email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSSYMBOLLEVELSDIALOG_H
16#define QGSSYMBOLLEVELSDIALOG_H
17
18#include <QDialog>
19#include "qgis_sip.h"
20#include <QList>
21#include <QItemDelegate>
22
23#include "qgshelp.h"
24#include "qgspanelwidget.h"
25#include "qgsrenderer.h"
26
27#include "ui_qgssymbollevelsdialogbase.h"
28#include "qgis_gui.h"
29
37class GUI_EXPORT QgsSymbolLevelsWidget : public QgsPanelWidget, private Ui::QgsSymbolLevelsDialogBase
38{
39 Q_OBJECT
40 public:
41
45 QgsSymbolLevelsWidget( QgsFeatureRenderer *renderer, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
46
52 QgsSymbolLevelsWidget( const QgsLegendSymbolList &symbols, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
53
55 bool usingLevels() const;
56
62 QgsLegendSymbolList symbolLevels() const;
63
68 void setForceOrderingEnabled( bool enabled );
69
70 public slots:
71
77 Q_DECL_DEPRECATED void apply() SIP_DEPRECATED;
78
79 private slots:
80 void updateUi();
81
82 void renderingPassChanged( int row, int column );
83
84 private:
85 void populateTable();
86 void setDefaultLevels();
87
89 int mMaxLayers = 0;
90
91 QgsFeatureRenderer *mRenderer = nullptr;
92 QgsLegendSymbolList mLegendSymbols;
93
95 bool mForceOrderingEnabled = false;
96};
97
98
105class GUI_EXPORT QgsSymbolLevelsDialog : public QDialog
106{
107 Q_OBJECT
108 public:
109
111 QgsSymbolLevelsDialog( QgsFeatureRenderer *renderer, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
112
113 // used by rule-based renderer (to hide checkbox to enable/disable ordering)
114 void setForceOrderingEnabled( bool enabled );
115
121 bool usingLevels() const;
122
128 QgsLegendSymbolList symbolLevels() const;
129
130 private:
131
132 QgsSymbolLevelsWidget *mWidget = nullptr;
133
134 private slots:
135
136 void showHelp();
137};
138
139#ifndef SIP_RUN
141
142// delegate used from Qt Spin Box example
143class SpinBoxDelegate : public QItemDelegate
144{
145 Q_OBJECT
146
147 public:
148 explicit SpinBoxDelegate( QObject *parent = nullptr ) : QItemDelegate( parent ) {}
149
150 QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex &/*index*/ ) const override;
151
152 void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
153
154 void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
155
156 void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex & /*index*/ ) const override;
157
158};
159
161#endif
162
163#endif // QGSSYMBOLLEVELSDIALOG_H
Base class for any widget that can be shown as a inline panel.
A dialog which allows the user to modify the rendering order of symbol layers.
A widget which allows the user to modify the rendering order of symbol layers.
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
QList< QgsLegendSymbolItem > QgsLegendSymbolList