27 #include "../../common/Translator.h"
28 #include "../../datatype/Property.h"
29 #include "../Exception.h"
37 : AbstractTreeItem(parent),
45 if(m_property && (m_property->getParent() == 0))
58 if(role == Qt::DisplayRole && column == 0)
59 return QVariant(m_property->getName().c_str());
61 if(role == Qt::CheckStateRole && column == 0 && litem != 0)
62 return ((m_selected && litem->
isSelected()) ? Qt::Checked : Qt::Unchecked);
85 return Qt::ItemIsUserCheckable;
99 if(role == Qt::CheckStateRole)
102 Qt::CheckState checkState =
static_cast<Qt::CheckState
>(value.toInt(&ok));
109 if(checkState == Qt::Checked)
111 else if(checkState == Qt::Unchecked)
132 m_selected = selected;
142 return "LEGEND_ITEM";
QMenu * getMenu(QWidget *parent=0) const
bool canFetchMore() const
void isSelected(bool selected)
Set the Layer as selected.
bool setData(int column, const QVariant &value, int role=Qt::EditRole)
te::map::AbstractLayerPtr getLayer() const
QVariant data(int column, int role) const
It models a property definition.
te::dt::Property * getProperty() const
void setSelected(bool selected)
Set the Property as selected.
bool isSelected()
Check if the Property is selected.
Qt::ItemFlags flags() const
A class that represents a Property in a LayerTreeModel.
PropertyItem(te::dt::Property *p, te::qt::widgets::AbstractTreeItem *parent)
A class that represents a Layer in a LayerTreeModel.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
const std::string getItemType() const
It returns the item type.