2
/***************************************************************************
3
qgslegenditem.h - description
5
begin : Sun Jul 28 2002
6
copyright : (C) 2002 by Gary E.Sherman
7
email : sherman at mrcc dot com
8
Romans 3:23=>Romans 6:23=>Romans 5:8=>Romans 10:9,10=>Romans 12
9
***************************************************************************/
11
/***************************************************************************
13
* This program is free software; you can redistribute it and/or modify *
14
* it under the terms of the GNU General Public License as published by *
15
* the Free Software Foundation; either version 2 of the License, or *
16
* (at your option) any later version. *
18
***************************************************************************/
21
#ifndef QGSLEGENDITEM_H
22
#define QGSLEGENDITEM_H
24
#include <qlistview.h>
31
* \class QgsLegendItem
32
* \brief An item in a QgsLegend
34
*@author Gary E.Sherman
37
class QgsLegendItem : public QCheckListItem
42
* @param lyr Map layer this legend item represents
43
* @param parent The parent listview
45
QgsLegendItem(QgsMapLayer * lyr = 0, QListView * parent = 0);
48
virtual ~QgsLegendItem();
50
/** Write property of QString layerName. */
51
virtual void setLayerName(const QString & _newVal);
53
/** Write property of QString displayName. */
54
// DEPRECATED? virtual void setDisplayName(const QString & _newVal);
56
/*! Responds to changes in the layer state (eg. visible vs non visible)
57
*@param v True if layer is visible
59
void stateChange(bool v);
61
/*! Gets the layer associated with this legend item
62
* @return Pointer to the layer
64
virtual QgsMapLayer *layer();
66
/** returns layer ID of associated map layer
68
QString layerID() const;
70
/** sets check box state and consequently the visibility of corresponding map layer */
73
private: // Private attributes
76
QgsMapLayer * m_layer;
80
public: // Public attributes
82
/** This is the name as rendered in the legend item pixmap */
83
// DEPRECATED? QString displayName;
85
/** The layer name as stored originaly in the dataset */