QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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
36class GUI_EXPORT QgsSymbolLevelsWidget : public QgsPanelWidget, private Ui::QgsSymbolLevelsDialogBase
37{
38 Q_OBJECT
39 public:
43 QgsSymbolLevelsWidget( QgsFeatureRenderer *renderer, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
44
50 QgsSymbolLevelsWidget( const QgsLegendSymbolList &symbols, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
51
53 bool usingLevels() const;
54
60 QgsLegendSymbolList symbolLevels() const;
61
66 void setForceOrderingEnabled( bool enabled );
67
68 public slots:
69
75 Q_DECL_DEPRECATED void apply() SIP_DEPRECATED;
76
77 private slots:
78 void updateUi();
79
80 void renderingPassChanged( int row, int column );
81
82 private:
83 void populateTable();
84 void setDefaultLevels();
85
87 int mMaxLayers = 0;
88
89 QgsFeatureRenderer *mRenderer = nullptr;
90 QgsLegendSymbolList mLegendSymbols;
91
93 bool mForceOrderingEnabled = false;
94};
95
96
103class GUI_EXPORT QgsSymbolLevelsDialog : public QDialog
104{
105 Q_OBJECT
106 public:
108 QgsSymbolLevelsDialog( QgsFeatureRenderer *renderer, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
109
110 // used by rule-based renderer (to hide checkbox to enable/disable ordering)
111 void setForceOrderingEnabled( bool enabled );
112
118 bool usingLevels() const;
119
125 QgsLegendSymbolList symbolLevels() const;
126
127 private:
128 QgsSymbolLevelsWidget *mWidget = nullptr;
129
130 private slots:
131
132 void showHelp();
133};
134
135#ifndef SIP_RUN
137
138// delegate used from Qt Spin Box example
139class SpinBoxDelegate : public QItemDelegate
140{
141 Q_OBJECT
142
143 public:
144 explicit SpinBoxDelegate( QObject *parent = nullptr )
145 : QItemDelegate( parent ) {}
146
147 QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/ ) const override;
148
149 void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
150
151 void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
152
153 void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex & /*index*/ ) const override;
154};
155
157#endif
158
159#endif // QGSSYMBOLLEVELSDIALOG_H
Abstract base class for all 2D vector feature renderers.
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