QGIS API Documentation  3.27.0-Master (597e8eebd4)
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 <QPointer>
20 #include <QWidget>
22 
23 
24 class QSlider;
25 class QTimer;
26 class QgsMapLayer;
27 
29 
31 
37 class QgsLayerTreeOpacityWidget : public QWidget
38 {
39  Q_OBJECT
40  public:
41  QgsLayerTreeOpacityWidget( QgsMapLayer *layer );
42 
43  QSize sizeHint() const override;
44 
45  class Provider : public QgsLayerTreeEmbeddedWidgetProvider
46  {
47  public:
48  QString id() const override;
49  QString name() const override;
50  QgsLayerTreeOpacityWidget *createWidget( QgsMapLayer *layer, int widgetIndex ) override;
51  bool supportsLayer( QgsMapLayer *layer ) override;
52  };
53 
54  public slots:
55  void sliderValueChanged( int value );
56  void updateOpacityFromSlider();
57  void layerTrChanged();
58 
59  private:
60  QPointer<QgsMapLayer> mLayer;
61  QSlider *mSlider = nullptr;
62  QTimer *mTimer = nullptr;
63 };
65 #endif // QGSLAYERTREEEMBEDDEDWIDGETSIMPL_H
Provider interface to be implemented in order to introduce new kinds of embedded widgets for use in l...
Base class for all map layer types.
Definition: qgsmaplayer.h:73
#define SIP_NO_FILE