21 #include <QGraphicsPixmapItem> 33 enum {Type = UserType + Image
49 ImageItem(
double x0 = 1,
double y0 = 1, QGraphicsItem* parent = 0,
50 const QUrl& url = QUrl(),
bool visible =
true,
double scaleX = 1,
51 double scaleY = 1,
double dir = 0);
63 ImageItem(
const KConfigGroup* plo,
const QUrl& urlPlo,
64 QGraphicsItem* parent = 0);
77 static bool boundingBox(
const QUrl& url, QString& filename,
double* x1,
78 double* y1,
double* x2,
double* y2);
84 static bool checkBoundingBox(
const QUrl& url);
86 inline double dir()
const {
return m_dir; };
88 virtual void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option,
96 void renderPS(QPixmap* pixmap,
int dpiX,
int dpiY);
109 static void renderPS(
const QString& psFile,
const QString& imageFile,
110 int width,
int height,
double x0 = 0,
double y0 = 0,
111 double scaleX = 1,
double scaleY = 1,
112 const char format[] =
"pbmraw");
114 inline double scaleX()
const {
return m_scaleX; };
116 inline double scaleY()
const {
return m_scaleY; };
121 inline void setDir(
double dir) { m_dir = dir; };
126 void setProperties(
const QTransform& m);
141 inline void setUrl(
const QUrl& url) { m_url = url; };
143 virtual int type()
const {
return Type; };
145 inline const QUrl&
url()
const {
return m_url; };
154 void writePlo(KConfigGroup* plo,
const QUrl& urlPlo,
bool absolute)
const;
158 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
160 void setProperties();
161 double m_scaleX, m_scaleY, m_dir;
virtual int type() const
Returns specific QGraphicsItem type number.
Definition: imageitem.h:143
const QUrl & url() const
Returns URL of PostScript file.
Definition: imageitem.h:145
void setScaleX(double f)
Sets horizontal scaling factor.
Definition: imageitem.h:131
void setScaleY(double f)
Sets vertical scaling factor.
Definition: imageitem.h:136
void setDir(double dir)
Sets rotation angle.
Definition: imageitem.h:121
Decoration item class.
Definition: decoitem.h:35
Image item class.
Definition: imageitem.h:29
double scaleY() const
Returns vertical scaling factor.
Definition: imageitem.h:116
void writePlo(KConfigGroup *plo, bool visible) const
Writes into plot file.
double scaleX() const
Returns horizontal scaling factor.
Definition: imageitem.h:114
void setUrl(const QUrl &url)
Sets URL.
Definition: imageitem.h:141
double dir() const
Returns rotation angle in deg.
Definition: imageitem.h:86