QGIS API Documentation  2.99.0-Master (314842d)
qgspalettedrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspalettedrendererwidget.h
3  ---------------------------
4  begin : February 2012
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSPALETTEDRENDERERWIDGET_H
19 #define QGSPALETTEDRENDERERWIDGET_H
20 
22 #include "ui_qgspalettedrendererwidgetbase.h"
23 #include "qgis_gui.h"
24 
25 class QgsRasterLayer;
26 
30 class GUI_EXPORT QgsPalettedRendererWidget: public QgsRasterRendererWidget, private Ui::QgsPalettedRendererWidgetBase
31 {
32  Q_OBJECT
33 
34  public:
35 
37  static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) { return new QgsPalettedRendererWidget( layer, extent ); }
38 
39  QgsRasterRenderer *renderer() override;
40 
41  void setFromRenderer( const QgsRasterRenderer *r );
42 
43  private:
44 
45  enum Column
46  {
47  ValueColumn = 0,
48  ColorColumn = 1,
49  LabelColumn = 2,
50  };
51 
52  QMenu *contextMenu = nullptr;
53 
54  private slots:
55 
56  void on_mTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
57  void on_mTreeWidget_itemChanged( QTreeWidgetItem *item, int column );
58  void changeColor();
59  void changeTransparency();
60 };
61 
62 #endif // QGSPALETTEDRENDERERWIDGET_H
A rectangle specified with double values.
Definition: qgsrectangle.h:36
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
virtual QgsRasterRenderer * renderer()=0
Raster renderer pipe that applies colors to a raster.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)