QGIS API Documentation 3.41.0-Master (45a0abf3bec)
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:
40
44 QgsSymbolLevelsWidget( QgsFeatureRenderer *renderer, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
45
51 QgsSymbolLevelsWidget( const QgsLegendSymbolList &symbols, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
52
54 bool usingLevels() const;
55
61 QgsLegendSymbolList symbolLevels() const;
62
67 void setForceOrderingEnabled( bool enabled );
68
69 public slots:
70
76 Q_DECL_DEPRECATED void apply() SIP_DEPRECATED;
77
78 private slots:
79 void updateUi();
80
81 void renderingPassChanged( int row, int column );
82
83 private:
84 void populateTable();
85 void setDefaultLevels();
86
88 int mMaxLayers = 0;
89
90 QgsFeatureRenderer *mRenderer = nullptr;
91 QgsLegendSymbolList mLegendSymbols;
92
94 bool mForceOrderingEnabled = false;
95};
96
97
104class GUI_EXPORT QgsSymbolLevelsDialog : public QDialog
105{
106 Q_OBJECT
107 public:
108
110 QgsSymbolLevelsDialog( QgsFeatureRenderer *renderer, bool usingSymbolLevels, QWidget *parent SIP_TRANSFERTHIS = nullptr );
111
112 // used by rule-based renderer (to hide checkbox to enable/disable ordering)
113 void setForceOrderingEnabled( bool enabled );
114
120 bool usingLevels() const;
121
127 QgsLegendSymbolList symbolLevels() const;
128
129 private:
130
131 QgsSymbolLevelsWidget *mWidget = nullptr;
132
133 private slots:
134
135 void showHelp();
136};
137
138#ifndef SIP_RUN
140
141// delegate used from Qt Spin Box example
142class SpinBoxDelegate : public QItemDelegate
143{
144 Q_OBJECT
145
146 public:
147 explicit SpinBoxDelegate( QObject *parent = nullptr ) : QItemDelegate( parent ) {}
148
149 QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex &/*index*/ ) const override;
150
151 void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
152
153 void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
154
155 void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex & /*index*/ ) const override;
156
157};
158
160#endif
161
162#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