QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgslayertreeviewindicator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayertreeviewindicator.h
3  --------------------------------------
4  Date : January 2018
5  Copyright : (C) 2018 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 QGSLAYERTREEVIEWINDICATOR_H
17 #define QGSLAYERTREEVIEWINDICATOR_H
18 
19 #include "qgis_gui.h"
20 #include "qgis_sip.h"
21 
22 #include <QIcon>
23 #include <QObject>
24 
35 class GUI_EXPORT QgsLayerTreeViewIndicator : public QObject
36 {
37  Q_OBJECT
38  public:
40  explicit QgsLayerTreeViewIndicator( QObject *parent SIP_TRANSFERTHIS = nullptr );
41 
43  QIcon icon() const { return mIcon; }
45  void setIcon( const QIcon &icon ) { mIcon = icon; emit changed(); }
46 
48  QString toolTip() const { return mToolTip; }
50  void setToolTip( const QString &tip ) { mToolTip = tip; }
51 
52  signals:
54  void clicked( const QModelIndex &index );
55 
60  void changed();
61 
62  private:
63  QIcon mIcon;
64  QString mToolTip;
65 };
66 
67 #endif // QGSLAYERTREEVIEWINDICATOR_H
QgsLayerTreeViewIndicator
Definition: qgslayertreeviewindicator.h:35
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53