QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
layertree
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
36
class
GUI_EXPORT
QgsLayerTreeViewIndicator
:
public
QObject
37
{
38
Q_OBJECT
39
public
:
41
explicit
QgsLayerTreeViewIndicator
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
42
44
QIcon
icon
()
const
{
return
mIcon; }
46
void
setIcon
(
const
QIcon &
icon
)
47
{
48
mIcon =
icon
;
49
emit
changed
();
50
}
51
53
QString
toolTip
()
const
{
return
mToolTip; }
55
void
setToolTip
(
const
QString &tip ) { mToolTip = tip; }
56
57
signals:
59
void
clicked
(
const
QModelIndex &index );
60
65
void
changed
();
66
67
private
:
68
QIcon mIcon;
69
QString mToolTip;
70
};
71
72
#endif
// QGSLAYERTREEVIEWINDICATOR_H
QgsLayerTreeViewIndicator::QgsLayerTreeViewIndicator
QgsLayerTreeViewIndicator(QObject *parent=nullptr)
Constructs an indicator, optionally transferring ownership to a parent QObject.
Definition
qgslayertreeviewindicator.cpp:20
QgsLayerTreeViewIndicator::toolTip
QString toolTip() const
Returns tool tip text that will be shown when user hovers mouse over the indicator.
Definition
qgslayertreeviewindicator.h:53
QgsLayerTreeViewIndicator::icon
QIcon icon() const
Indicator icon that will be displayed in the layer tree view.
Definition
qgslayertreeviewindicator.h:44
QgsLayerTreeViewIndicator::changed
void changed()
Emitted when the indicator changes state (e.g.
QgsLayerTreeViewIndicator::clicked
void clicked(const QModelIndex &index)
Emitted when user clicks on the indicator.
QgsLayerTreeViewIndicator::setToolTip
void setToolTip(const QString &tip)
Sets tool tip text.
Definition
qgslayertreeviewindicator.h:55
QgsLayerTreeViewIndicator::setIcon
void setIcon(const QIcon &icon)
Sets indicator icon that will be displayed in the layer tree view.
Definition
qgslayertreeviewindicator.h:46
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
Generated on
for QGIS API Documentation by
1.17.0