QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 
30 
36 class QgsLayerTreeOpacityWidget : public QWidget
37 {
38  Q_OBJECT
39  public:
40  QgsLayerTreeOpacityWidget( QgsMapLayer *layer );
41 
42  QSize sizeHint() const override;
43 
44  class Provider : public QgsLayerTreeEmbeddedWidgetProvider
45  {
46  public:
47  QString id() const override;
48  QString name() const override;
49  QgsLayerTreeOpacityWidget *createWidget( QgsMapLayer *layer, int widgetIndex ) override;
50  bool supportsLayer( QgsMapLayer *layer ) override;
51  };
52 
53  public slots:
54  void sliderValueChanged( int value );
55  void updateOpacityFromSlider();
56  void layerTrChanged();
57 
58  private:
59  QgsMapLayer *mLayer = nullptr;
60  QSlider *mSlider = nullptr;
61  QTimer *mTimer = nullptr;
62 };
64 #endif // QGSLAYERTREEEMBEDDEDWIDGETSIMPL_H
Base class for all map layer types.
Definition: qgsmaplayer.h:79
Provider interface to be implemented in order to introduce new kinds of embedded widgets for use in l...
#define SIP_NO_FILE
Definition: qgis_sip.h:23