flagobj.cpp
changeset 409 81ffad43d53f
parent 406 1c8ff1928b97
child 425 7014be3ac7d0
     1.1 --- a/flagobj.cpp	Thu Nov 23 13:53:08 2006 +0000
     1.2 +++ b/flagobj.cpp	Fri Dec 08 20:18:58 2006 +0000
     1.3 @@ -9,9 +9,9 @@
     1.4      init ();
     1.5  }
     1.6  
     1.7 -FlagObj::FlagObj(Q3Canvas* c):MapObj(c) 
     1.8 +FlagObj::FlagObj(QGraphicsScene* s):MapObj(s) 
     1.9  {
    1.10 -//	cout << "Const FlagObj  canvas="<<c<<endl;
    1.11 +//	cout << "Const FlagObj  this="<<this<<"  scene="<<s<<endl;
    1.12      init ();
    1.13  }
    1.14  
    1.15 @@ -22,7 +22,7 @@
    1.16  
    1.17  FlagObj::~FlagObj()
    1.18  {
    1.19 -//    cout << "Destr FlagObj  " << name.ascii() << "\n";
    1.20 +//    cout << "Destr FlagObj  this="<<this <<"  " << name.ascii() << "\n";
    1.21  	if (icon) delete (icon);
    1.22  }
    1.23  
    1.24 @@ -32,8 +32,8 @@
    1.25  	name="undefined";
    1.26  	group="undefined";
    1.27  
    1.28 -	icon=new ImageObj (canvas);
    1.29 -	icon->move (absPos.x(), absPos.y() );
    1.30 +	icon=new ImageObj (scene);
    1.31 +	icon->setPos (absPos.x(), absPos.y() );
    1.32  	state=false;
    1.33  	action=NULL;
    1.34  }
    1.35 @@ -53,7 +53,7 @@
    1.36  void FlagObj::move(double x, double y)
    1.37  {
    1.38      MapObj::move(x,y);
    1.39 -	icon->move(x,y);
    1.40 +	icon->setPos(x,y);
    1.41  	positionBBox();
    1.42  }
    1.43  
    1.44 @@ -117,7 +117,7 @@
    1.45  
    1.46  QPixmap FlagObj::getPixmap()
    1.47  {
    1.48 -	return icon->getPixmap();
    1.49 +	return icon->pixmap();
    1.50  }
    1.51  
    1.52  void FlagObj::setAction (QAction* a)
    1.53 @@ -150,6 +150,8 @@
    1.54  	if (visible) 
    1.55  	{
    1.56  		icon->setVisibility (true);
    1.57 +		//icon->setPos (100,100);
    1.58 +		//icon->setPos (rand()%100,rand()%130);
    1.59  		calcBBoxSize();
    1.60  	}	
    1.61  }
    1.62 @@ -191,12 +193,12 @@
    1.63  {
    1.64  	if (visible && state)
    1.65  	{
    1.66 -		bbox.setSize (	QSize(
    1.67 +		bbox.setSize (	QSizeF(
    1.68  			icon->boundingRect().width(), 
    1.69  			icon->boundingRect().height() ) );
    1.70  	} else
    1.71  	{
    1.72 -		bbox.setSize (QSize(0,0));
    1.73 +		bbox.setSize (QSizeF(0,0));
    1.74  	}
    1.75  	clickBox.setSize (bbox.size());
    1.76  }