27 #include "../../../../common/Translator.h"
28 #include "../../../../maptools/RasterLayer.h"
29 #include "../../../../se/Style.h"
30 #include "../../Exception.h"
35 #include <QtGui/QMenu>
36 #include <QtGui/QWidget>
58 if(role == Qt::DisplayRole)
59 return QVariant(QString::fromStdString(m_layer->getTitle()));
61 if(role == Qt::CheckStateRole)
62 return QVariant(m_layer->getVisibility() ==
te::map::VISIBLE ? Qt::Checked : Qt::Unchecked);
81 return children().isEmpty();
86 return Qt::ItemIsUserCheckable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;;
91 if(!children().isEmpty())
110 if(role == Qt::CheckStateRole)
113 Qt::CheckState checkState =
static_cast<Qt::CheckState
>(value.toInt(&ok));
118 if(checkState == Qt::Checked)
120 else if(checkState == Qt::Unchecked)
136 return "RASTER_LAYER_ITEM";
const std::string getItemType() const
It returns the item type: "RASTER_LAYER_ITEM".
A class that represents a legend item of a layer in a LayerTreeModel.
te::map::RasterLayerPtr m_layer
QMenu * getMenu(QWidget *parent=0) const
RasterLayerItem(const te::map::AbstractLayerPtr &l, QObject *parent=0)
Qt::ItemFlags flags() const
QVariant data(int column, int role) const
The class that represents a raster layer item in a LayerTreeModel.
The class that represents an item in a LayerTreeModel.
bool setData(int column, const QVariant &value, int role=Qt::EditRole)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
A layer with reference to a raster.
te::map::AbstractLayerPtr getLayer() const
bool canFetchMore() const