3 #include "../../../core/utils/Platform.h" 4 #include "../../widgets/layer/explorer/LayerItem.h" 11 QPainterPath star, aux;
13 aux.setFillRule(Qt::WindingFill);
16 for(
int i = 1; i < 5; ++i)
18 QPointF pt(0.5 + 0.5 * cos(0.8 * i * 3.14),
19 0.5 + 0.5 * sin(0.8 * i * 3.14));
21 star = aux.simplified();
30 m.scale(markSize*2, markSize*2);
32 return m.map(markShape);
37 QImage img(size, QImage::Format_ARGB32_Premultiplied);
45 p.translate(img.rect().center()-star.boundingRect().center());
47 p.fillPath(star, Qt::color1);
48 p.setPen(QPen(Qt::color1, 1));
52 p.setPen(QPen(Qt::black, 1));
60 QPixmap p1 = QIcon::fromTheme(
"dataset-layer").pixmap(20, 20);
70 pt.drawPixmap(5, 5, p2);
79 te::common::Decorator<QStyledItemDelegate>(decorated)
89 void EditDelegate::paint(QPainter* painter,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const 92 QStyleOptionViewItem opt(option);
98 if (l->getType() ==
"DATASETLAYER")
102 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 105 opt.palette.setColor(QPalette::Text, Qt::green);
106 opt.font.setItalic(
true);
107 opt.font.setBold(
true);
111 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 114 opt.palette.setColor(QPalette::Text, Qt::red);
115 opt.font.setItalic(
true);
116 opt.font.setBold(
true);
std::set< std::string > m_edited
QImage GetStarImage(const QSize &size, const QColor &c)
QIcon GetIcon(const bool &stash)
std::set< std::string > m_stashed
QPainterPath RecalculateMark(const QPainterPath &markShape, const int &markSize)
QStyledItemDelegate * m_decorated
The object decorated.
void addEdited(const std::string &lName)
void addStashed(const std::string &lName)
TECOREEXPORT std::string FindInTerraLibPath(const std::string &path)
Returns the path relative to a directory or file in the context of TerraLib.
EditDelegate(QStyledItemDelegate *decorated, QObject *parent=0)
void removeStashed(const std::string &lName)
bool isStached(const std::string &lName)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void removeEdited(const std::string &lName)
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void paint(te::qt::widgets::Canvas *c, bool generatePNG, std::string fileName)