diff -r e95081c21da2 -r c2a05fa925a1 imageobj.cpp --- a/imageobj.cpp Tue Sep 05 09:47:14 2006 +0000 +++ b/imageobj.cpp Fri Dec 08 20:18:56 2006 +0000 @@ -1,16 +1,17 @@ #include "imageobj.h" -//Added by qt3to4: -#include +#include "mapobj.h" ///////////////////////////////////////////////////////////////// // ImageObj ///////////////////////////////////////////////////////////////// -ImageObj::ImageObj( Q3Canvas *canvas ) - : Q3CanvasRectangle( canvas ) +ImageObj::ImageObj( QGraphicsScene *scene) : QGraphicsPixmapItem (NULL,scene ) { -// cout << "Const ImageObj (canvas)\n"; - setZ(Z_ICON); - type=undef; +// cout << "Const ImageObj (scene)\n"; + + setShapeMode (QGraphicsPixmapItem::BoundingRectShape); + setZValue(Z_ICON); + mapScene=scene; + hide(); } ImageObj::~ImageObj() @@ -20,13 +21,9 @@ void ImageObj::copy(ImageObj* other) { - setSize (other->width(), other->height() ); setVisibility (other->isVisible() ); - type=other->type; -// if (type==qimage) - image=other->image; -// if (type==qpixmap) - pixmap=other->pixmap; + setPixmap (other->QGraphicsPixmapItem::pixmap()); + setPos (other->pos()); } void ImageObj::setVisibility (bool v) @@ -39,64 +36,24 @@ void ImageObj::save(const QString &fn, const char *format) { - switch (type) - { - case undef: qWarning("Warning: ImageObj::save() type=undef");break; - case qimage: image.save (fn,format,-1);break; - case qpixmap: pixmap.save (fn,format,-1);break; - } + pixmap().save (fn,format,-1); } bool ImageObj::load (const QString &fn) { - if (!image.load( fn) ) - //cout << "Fatal Error in ImageObj::load ("<