QGIS API Documentation  2.17.0-Master (f49f7ce)
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 
29 class GUI_EXPORT QgsSymbolLevelsV2Dialog : public QDialog, private Ui::QgsSymbolLevelsV2DialogBase
30 {
31  Q_OBJECT
32  public:
34  QgsSymbolLevelsV2Dialog( const QgsLegendSymbolList& list, bool usingSymbolLevels, QWidget* parent = nullptr );
35 
37 
38  bool usingLevels() const;
39 
40  // used by rule-based renderer (to hide checkbox to enable/disable ordering)
41  void setForceOrderingEnabled( bool enabled );
42 
43  public slots:
44  void updateUi();
45 
46  void renderingPassChanged( int row, int column );
47 
48  protected:
50  void populateTable();
52  void setDefaultLevels();
53 
54  protected:
60 };
61 
63 
64 // delegate used from Qt Spin Box example
65 class SpinBoxDelegate : public QItemDelegate
66 {
67  Q_OBJECT
68 
69  public:
70  explicit SpinBoxDelegate( QObject *parent = nullptr ) : QItemDelegate( parent ) {}
71 
72  QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex &/*index*/ ) const override;
73 
74  void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
75 
76  void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
77 
78  void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex & /*index*/ ) const override;
79 
80 };
81 
83 
84 #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)