24 #include "../../../dataaccess/dataset/ObjectIdSet.h"
25 #include "../../../dataaccess/dataset/ObjectId.h"
26 #include "../../../dataaccess/dataset/DataSet.h"
27 #include "../../../dataaccess/utils/Utils.h"
52 for(
size_t i=0; i<cols.size(); i++)
55 return (data.find(pkey) != data.end());
60 boost::ptr_vector<te::dt::AbstractData> data = oid->
getValue();
61 boost::ptr_vector<te::dt::AbstractData>::iterator it;
65 for(it=data.begin(); it!=data.end(); ++it)
66 pkey += it->toString() +
";";
73 std::set<std::string> res;
77 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator it;
79 for(it=objs->
begin(); it!=objs->
end(); ++it)
87 QItemDelegate(parent),
104 QStyleOptionViewItem opt = option;
107 if(
ToHighlight(m_dset, m_objs->getPropertyPos(), m_oids, (int)m_promoter->getLogicalRow(index.row())))
109 opt.showDecorationSelected =
true;
110 opt.state |= QStyle::State_Selected;
111 opt.palette.setColor(QPalette::Highlight, m_color);
112 opt.palette.setColor(QPalette::HighlightedText, Qt::black);
115 QItemDelegate::paint(painter, opt, index);
145 m_objs = objs->
clone();
157 m_promoter = promoter;
Defines an mechanism for logical ordering of rows.
std::set< std::string > GetOidsAsString(const te::da::ObjectIdSet *objs)
A delegate for highlight the selected object ids.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
virtual void setObjectIdSet(const te::da::ObjectIdSet *objs)
Sets the object id set. It WILL NOT TAKE the ownership of the objs.
void setPromoter(Promoter *promoter)
Sets the promoter being used.
virtual std::string getAsString(std::size_t i, int precision=0) const
Method for retrieving a data value as a string plain representation.
const boost::ptr_vector< te::dt::AbstractData > & getValue() const
It gets the properties values used to uniquely identify a data set element.
bool ToHighlight(te::da::DataSet *dset, const te::da::ObjectIdSet *objs, const int &row)
virtual void setDataSet(te::da::DataSet *dset)
Sets the current data set being used. This method DOES NOT take the ownership of the dset...
const std::vector< std::string > & getPropertyNames() const
It returns the property names used to generated the oids.
HighlightDelegate(QObject *parent=0)
Constructor.
TEDATAACCESSEXPORT ObjectId * GenerateOID(DataSet *dataset, const std::vector< std::string > &names)
virtual ~HighlightDelegate()
Destructor.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator begin() const
Returns an iterator for the object ids in container.
QColor getColor()
Returns the color.
virtual const te::da::ObjectIdSet * getSelected() const
Returns the identifiers of the rows highlighted.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator end() const
Returns an iterator for the object ids in container.
std::string GetOidAsString(const te::da::ObjectId *oid)
This class represents an unique id for a data set element.
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
bool contains(ObjectId *oid) const
It returns if the object id set contains the given oid.
ObjectIdSet * clone() const
virtual bool move(std::size_t i)=0
It moves the dataset internal pointer to a given position.
A dataset is the unit of information manipulated by the data access module of TerraLib.
A class used for logical ordering of rows.
virtual void setColor(const QColor &c)
Update the color group.