frameobj.cpp
changeset 417 1cc7bbf75f0b
parent 366 e95081c21da2
child 421 5522d1da7e37
     1.1 --- a/frameobj.cpp	Tue Sep 05 09:47:14 2006 +0000
     1.2 +++ b/frameobj.cpp	Fri Jan 05 11:17:32 2007 +0000
     1.3 @@ -11,7 +11,7 @@
     1.4      init ();
     1.5  }
     1.6  
     1.7 -FrameObj::FrameObj(Q3Canvas* c) :MapObj(c)
     1.8 +FrameObj::FrameObj(QGraphicsScene *s) :MapObj(s)
     1.9  {
    1.10  //    cout << "Const FrameObj\n";
    1.11      init ();
    1.12 @@ -49,7 +49,7 @@
    1.13  		case NoFrame:
    1.14  			break;
    1.15  		case Rectangle:
    1.16 -			rectFrame->move (x,y);
    1.17 +			rectFrame->setPos (x,y);
    1.18  			break;
    1.19      }
    1.20  }
    1.21 @@ -67,7 +67,7 @@
    1.22  {
    1.23  }
    1.24  
    1.25 -void FrameObj::setRect(const QRect &r)
    1.26 +void FrameObj::setRect(const QRectF &r)
    1.27  {
    1.28  	bbox=r;
    1.29      switch (type)
    1.30 @@ -75,9 +75,7 @@
    1.31  		case NoFrame:
    1.32  			break;
    1.33  		case Rectangle:
    1.34 -			rectFrame->setX (bbox.x() );
    1.35 -			rectFrame->setY (bbox.y() );
    1.36 -			rectFrame->setSize (bbox.width(),bbox.height() );
    1.37 +			rectFrame->setRect (QRectF(bbox.x(),bbox.y(),bbox.width(),bbox.height() ));
    1.38  			break;
    1.39      }
    1.40  }
    1.41 @@ -117,10 +115,9 @@
    1.42  				break;
    1.43  			case Rectangle:
    1.44  				border=10;
    1.45 -				rectFrame = new Q3CanvasRectangle (canvas);
    1.46 -				rectFrame->setZ(Z_FRAME);
    1.47 -				rectFrame->setBrush( QColor("white") );
    1.48 -				rectFrame->setPen( QPen(QColor("black") ));
    1.49 +				rectFrame = scene->addRect(QRectF(0,0,0,0), QPen(QColor("black") ), QColor("white"));
    1.50 +				rectFrame->setZValue(Z_FRAME);
    1.51 +
    1.52  				break;
    1.53  		}
    1.54  		setVisibility (visible);