QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsrendererrasterpropertieswidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendererrasterpropertieswidget.h
3  ---------------------
4  begin : May 2016
5  copyright : (C) 2016 by Nathan Woodrow
6  email : woodrow dot nathan 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 QGSRENDERERRASTERPROPERTIESDIALOG_H
16 #define QGSRENDERERRASTERPROPERTIESDIALOG_H
17 
18 #include <QObject>
19 #include <QDialog>
20 
21 #include "ui_qgsrendererrasterpropswidgetbase.h"
22 
24 #include "qgis_gui.h"
25 
26 
27 class QgsRasterLayer;
28 class QgsMapCanvas;
30 
35 class GUI_EXPORT QgsRendererRasterPropertiesWidget : public QgsMapLayerConfigWidget, private Ui::QgsRendererRasterPropsWidgetBase
36 {
37  Q_OBJECT
38 
39  public:
40 
47  QgsRendererRasterPropertiesWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr );
48 
55  void setMapCanvas( QgsMapCanvas *canvas );
56 
60  QgsRasterRendererWidget *currentRenderWidget() { return mRendererWidget; }
61 
62  public slots:
64  void rendererChanged();
65 
67  void apply() override;
68 
73  void syncToLayer( QgsRasterLayer *layer );
74 
75  private slots:
77  void mResetColorRenderingBtn_clicked();
78 
80  void toggleSaturationControls( int grayscaleMode );
81 
83  void toggleColorizeControls( bool colorizeEnabled );
84 
85  void refreshAfterStyleChanged();
86 
87  private:
88  void setRendererWidget( const QString &rendererName );
89 
90  QgsRasterLayer *mRasterLayer = nullptr;
91  QgsRasterRendererWidget *mRendererWidget = nullptr;
92 };
93 
94 #endif // QGSRENDERERRASTERPROPERTIESDIALOG_H
QgsMapCanvas
Definition: qgsmapcanvas.h:83
QgsMapLayerConfigWidget::apply
virtual void apply()=0
Called when changes to the layer need to be made.
QgsMapLayerConfigWidget
A panel widget that can be shown in the map style dock.
Definition: qgsmaplayerconfigwidget.h:33
QgsRasterLayer
Definition: qgsrasterlayer.h:72
qgsmaplayerconfigwidget.h
QgsMapLayer
Definition: qgsmaplayer.h:81
QgsMapLayerConfigWidget::syncToLayer
virtual void syncToLayer(QgsMapLayer *layer)
Reset to original (vector layer) values.
Definition: qgsmaplayerconfigwidget.h:60
QgsRendererRasterPropertiesWidget::currentRenderWidget
QgsRasterRendererWidget * currentRenderWidget()
Returns the active render widget.
Definition: qgsrendererrasterpropertieswidget.h:60
QgsRasterRendererWidget
Definition: qgsrasterrendererwidget.h:36
QgsRendererRasterPropertiesWidget
Definition: qgsrendererrasterpropertieswidget.h:35