QGIS API Documentation  3.6.0-Noosa (5873452)
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; }
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 
56  private:
57  QIcon mIcon;
58  QString mToolTip;
59 };
60 
61 #endif // QGSLAYERTREEVIEWINDICATOR_H
void setIcon(const QIcon &icon)
Sets indicator icon that will be displayed in the layer tree view.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
void setToolTip(const QString &tip)
Sets tool tip text.
QString toolTip() const
Returns tool tip text that will be shown when user hovers mouse over the indicator.
Indicator that can be used in a layer tree view to display icons next to items of the layer tree...
QIcon icon() const
Indicator icon that will be displayed in the layer tree view.