30 #include "../../core/pattern/mvc/ItemController.h"
31 #include "../core/Scene.h"
32 #include "../../core/pattern/mvc/Observable.h"
33 #include "../../../color/RGBAColor.h"
34 #include "../../../qt/widgets/Utils.h"
35 #include "../../../geometry/Envelope.h"
36 #include "../../../common/STLUtils.h"
44 this->setFlags(QGraphicsItem::ItemIsMovable
45 | QGraphicsItem::ItemIsSelectable
46 | QGraphicsItem::ItemSendsGeometryChanges
47 | QGraphicsItem::ItemIsFocusable);
49 m_nameClass = std::string(this->metaObject()->className());
66 drawBackground( painter );
69 boundRect = boundingRect();
72 painter->translate( -boundRect.bottomLeft().x(), -boundRect.topRight().y() );
73 QRectF rtSource( 0, 0, m_pixmap.width(), m_pixmap.height() );
74 painter->drawPixmap(boundRect, m_pixmap, rtSource);
80 if (option->state & QStyle::State_Selected)
82 drawSelection(painter);
Abstract class to represent an observable. "Model" part of MVC component.
Abstract class to represent a controller. "Controller" part of MVC component. All classes representin...
virtual ~LegendChildItem()
Class that represents a graphic legend of a map. Its coordinate system is the same of scene (millimet...
std::string m_nameClass
Class name.
LegendChildItem(ItemController *controller, Observable *o)
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Mandatory implementation from QGraphicsItem.