QGIS API Documentation  2.14.0-Essen
qgssymbollevelsv2dialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbollevelsv2dialog.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 QGSSYMBOLLEVELSV2DIALOG_H
16 #define QGSSYMBOLLEVELSV2DIALOG_H
17 
18 #include <QDialog>
19 #include <QList>
20 #include <QItemDelegate>
21 
22 #include "qgsrendererv2.h"
23 
24 #include "ui_qgssymbollevelsv2dialogbase.h"
25 
26 
27 class GUI_EXPORT QgsSymbolLevelsV2Dialog : public QDialog, private Ui::QgsSymbolLevelsV2DialogBase
28 {
29  Q_OBJECT
30  public:
32  QgsSymbolLevelsV2Dialog( const QgsLegendSymbolList& list, bool usingSymbolLevels, QWidget* parent = nullptr );
33 
35 
36  bool usingLevels() const;
37 
38  // used by rule-based renderer (to hide checkbox to enable/disable ordering)
39  void setForceOrderingEnabled( bool enabled );
40 
41  public slots:
42  void updateUi();
43 
44  void renderingPassChanged( int row, int column );
45 
46  protected:
48  void populateTable();
50  void setDefaultLevels();
51 
52  protected:
58 };
59 
61 
62 // delegate used from Qt Spin Box example
63 class SpinBoxDelegate : public QItemDelegate
64 {
65  Q_OBJECT
66 
67  public:
68  explicit SpinBoxDelegate( QObject *parent = nullptr ) : QItemDelegate( parent ) {}
69 
70  QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex &/*index*/ ) const override;
71 
72  void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
73 
74  void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
75 
76  void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex & /*index*/ ) const override;
77 
78 };
79 
81 
82 #endif // QGSSYMBOLLEVELSV2DIALOG_H
static unsigned index
int mMaxLayers
maximal number of layers from all symbols
bool mForceOrderingEnabled
whether symbol layers always should be used (default false)