QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgslayertreeembeddedwidgetsimpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayertreeembeddedwidgetsimpl.h
3  --------------------------------------
4  Date : May 2016
5  Copyright : (C) 2016 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 
16 #ifndef QGSLAYERTREEEMBEDDEDWIDGETSIMPL_H
17 #define QGSLAYERTREEEMBEDDEDWIDGETSIMPL_H
18 
19 #include <QWidget>
21 
22 
23 class QSlider;
24 class QTimer;
25 class QgsMapLayer;
26 
28 
33 class QgsLayerTreeTransparencyWidget : public QWidget
34 {
35  Q_OBJECT
36  public:
37  QgsLayerTreeTransparencyWidget( QgsMapLayer* layer );
38 
39  virtual QSize sizeHint() const override;
40 
41  class Provider : public QgsLayerTreeEmbeddedWidgetProvider
42  {
43  public:
44  virtual QString id() const override;
45  virtual QString name() const override;
46  virtual QgsLayerTreeTransparencyWidget* createWidget( QgsMapLayer* layer, int widgetIndex ) override;
47  virtual bool supportsLayer( QgsMapLayer *layer ) override;
48  };
49 
50  public slots:
51  void sliderValueChanged( int value );
52  void updateTransparencyFromSlider();
53  void layerTrChanged();
54 
55  private:
56  QgsMapLayer* mLayer;
57  QSlider* mSlider;
58  QTimer* mTimer;
59 };
61 #endif // QGSLAYERTREEEMBEDDEDWIDGETSIMPL_H
Base class for all map layer types.
Definition: qgsmaplayer.h:49
Provider interface to be implemented in order to introduce new kinds of embedded widgets for use in l...
virtual QSize sizeHint() const