floatimageobj.cpp
changeset 376 626fd85b1f69
parent 334 df4fdaa07527
child 377 5391ab620c95
     1.1 --- a/floatimageobj.cpp	Wed May 31 12:27:38 2006 +0000
     1.2 +++ b/floatimageobj.cpp	Tue Sep 05 15:05:18 2006 +0000
     1.3 @@ -1,5 +1,7 @@
     1.4  #include "floatimageobj.h"
     1.5  #include "branchobj.h"
     1.6 +//Added by qt3to4:
     1.7 +#include <QPixmap>
     1.8  
     1.9  
    1.10  /////////////////////////////////////////////////////////////////
    1.11 @@ -17,7 +19,7 @@
    1.12      depth=-1;
    1.13  }
    1.14  
    1.15 -FloatImageObj::FloatImageObj (QCanvas* c):FloatObj(c)
    1.16 +FloatImageObj::FloatImageObj (Q3Canvas* c):FloatObj(c)
    1.17  {
    1.18   //   cout << "Const FloatImageObj (c)  called from MapCenterObj (c)\n";
    1.19      setParObj (this);	
    1.20 @@ -25,7 +27,7 @@
    1.21      depth=-1;
    1.22  }
    1.23  
    1.24 -FloatImageObj::FloatImageObj (QCanvas* c, OrnamentedObj* p):FloatObj(c,p)
    1.25 +FloatImageObj::FloatImageObj (Q3Canvas* c, OrnamentedObj* p):FloatObj(c,p)
    1.26  {
    1.27   //   cout << "Const FloatImageObj (c,p)\n";
    1.28      init();
    1.29 @@ -94,7 +96,7 @@
    1.30  		bbox.setSize (QSize(icon->size().width()+8, icon->size().height()+8));
    1.31  		positionBBox();
    1.32  		filename=fn;
    1.33 -		filetype=QPixmap::imageFormat (fn);
    1.34 +//FIXME QT3 was		filetype=QPixmap::imageFormat (fn);
    1.35  		setOriginalFilename (fn);
    1.36  		return true;
    1.37  	} else
    1.38 @@ -102,9 +104,9 @@
    1.39  	
    1.40  }
    1.41  
    1.42 -void FloatImageObj::save (const QString &fn, const char *format)
    1.43 +void FloatImageObj::save (const QString &fn, const QString &format)
    1.44  {	
    1.45 -	icon->save (fn,format);
    1.46 +	icon->save (fn,qPrintable (format));
    1.47  }
    1.48  
    1.49  void FloatImageObj::setOriginalFilename(const QString & fn)
    1.50 @@ -180,14 +182,10 @@
    1.51  	QString zAttr=attribut ("zPlane",QString().setNum(zPlane));
    1.52  	QString url;
    1.53  
    1.54 -	// prevent saving as GIF
    1.55 -	if (filetype=="GIF")
    1.56 -		filetype="PNG";
    1.57 -		
    1.58  	url="images/"+prefix+"image-" + QString().number(saveCounter,10) + "." +filetype;
    1.59  
    1.60  	// And really save the image
    1.61 -	icon->save (tmpdir + "/" + url, filetype);
    1.62 +	icon->save (tmpdir + "/" + url, "PNG");
    1.63   
    1.64  	QString nameAttr=attribut ("orgName",originalFilename);
    1.65