4 #include <QGraphicsPixmapItem>
5 #include <QGraphicsScene>
6 #include <QGraphicsSvgItem>
8 /*! \brief Base class for images, which can be pixmaps or svg
10 * ImageObj is used both by items part of the map "tree" in
11 * ImageItem and as flag in FlagObj
13 * Both of these types are actually drawn onto the map
16 class ImageObj : public QGraphicsItem {
18 enum ImageType { Undefined, Pixmap, SVG, ClonedSVG };
21 ImageObj(QGraphicsItem *);
24 void copy(ImageObj *);
25 void setPos(const QPointF &pos);
26 void setPos(const qreal &x, const qreal &y);
27 void setZValue(qreal z);
28 void setVisibility(bool);
29 void setWidth(qreal w);
30 void setScaleFactor(qreal f);
31 qreal getScaleFactor();
32 virtual QRectF boundingRect() const;
33 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
34 bool load(const QString &, bool createClone = false);
35 bool save(const QString &);
36 QString getExtension();
41 ImageObj::ImageType imageType;
43 QGraphicsSvgItem *svgItem;
46 QGraphicsPixmapItem *pixmapItem;