diff -r 5db8dfd30ea2 -r c2a05fa925a1 linkablemapobj.h --- a/linkablemapobj.h Thu Nov 23 16:18:26 2006 +0000 +++ b/linkablemapobj.h Fri Dec 08 20:18:56 2006 +0000 @@ -5,8 +5,7 @@ #include "noteobj.h" #include "headingobj.h" #include "flagrowobj.h" -//Added by qt3to4: -#include + #define MAX_DEPTH 999 @@ -25,7 +24,7 @@ Q_OBJECT public: LinkableMapObj (); - LinkableMapObj (Q3Canvas*); + LinkableMapObj (QGraphicsScene*); LinkableMapObj (LinkableMapObj*); ~LinkableMapObj (); virtual void delLink(); @@ -33,20 +32,20 @@ virtual void copy (LinkableMapObj*); void setChildObj (LinkableMapObj*); virtual void setParObj (LinkableMapObj*); - virtual void setParObjTmp (LinkableMapObj*,QPoint,int); // Only for moving Obj around + virtual void setParObjTmp (LinkableMapObj*,QPointF,int); // Only for moving Obj around virtual void unsetParObjTmp(); // reuse original ParObj virtual bool hasParObjTmp(); virtual void setUseRelPos (const bool&); virtual void setRelPos(); // set relPos to current parentPos - virtual void setRelPos(const QPoint&); - virtual QPoint getRelPos(); + virtual void setRelPos(const QPointF&); + virtual QPointF getRelPos(); virtual void setUseOrientation (const bool &); - virtual int getTopPad(); - virtual int getLeftPad(); - virtual int getRightPad(); + virtual qreal getTopPad(); + virtual qreal getLeftPad(); + virtual qreal getRightPad(); LinkStyle getDefLinkStyle(); void setLinkStyle(LinkStyle); LinkStyle getLinkStyle(); @@ -70,71 +69,72 @@ LinkableMapObj* getParObj(); // returns pointer to toObj virtual LinkableMapObj* findObjBySelect(QString s); // find obj by selectstring virtual void setDockPos()=0; // sets childPos and parPos - QPoint getChildPos(); // returns pos where childs dock - QPoint getParPos(); // returns pos where parents dock + QPointF getChildPos(); // returns pos where childs dock + QPointF getParPos(); // returns pos where parents dock LinkOrient getOrientation(); // get orientation virtual int getDepth(); // return depth virtual void setMapEditor(MapEditor*); // set MapEditor (needed in LMO::updateNoteFlag) virtual MapEditor* getMapEditor(); // get MapEditor (usually from parent); - virtual QPoint getRandPos(); // make randomised position + virtual QPointF getRandPos(); // make randomised position - //virtual void alignRelativeTo(const QPoint ); + //virtual void alignRelativeTo(const QPointF ); virtual void reposition(); virtual void requestReposition(); // do reposition after next user event virtual void forceReposition(); // to force a reposition now (outside // of mapeditor e.g. in noteeditor virtual bool repositionRequested(); - //virtual QRect getTotalBBox(); // return BBox including childs - //virtual QRect getBBoxSizeWithChilds();// return size of BBox including childs + //virtual QRectF getTotalBBox(); // return BBox including childs + //virtual QRectF getBBoxSizeWithChilds();// return size of BBox including childs virtual void calcBBoxSizeWithChilds()=0;// calc size of BBox including childs recursivly virtual void setSelBox(); virtual void select(); virtual void unselect(); virtual QString getSelectString()=0; - //virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data to XML + //virtual QString saveToDir (const QString&,const QString&, const QPointF&);// Save data to XML protected: - void parabel(Q3PointArray &,double,double,double,double); // Create Parabel connecting two points + void parabel(QPolygonF &,double,double,double,double); // Create Parabel connecting two points QString getLinkAttr(); - QPoint childPos; - QPoint parPos; + QPointF childPos; + QPointF parPos; bool link2ParPos; // While moving around, sometimes link to parent MapEditor* mapEditor; // for updateNoteFlag() and toggleScroll() LinkOrient orientation; - int linkwidth; // width of a link + qreal linkwidth; // width of a link int depth; // depth: undef=-1 mapCenter=0 branch=1..n - QRect bboxTotal; // bounding box including childs + QRectF bboxTotal; // bounding box including childs LinkableMapObj* childObj; LinkableMapObj* parObj; LinkableMapObj* parObjTmpBuf; // temporary buffer the original parent - int bottomlineY; // vertical offset of dockpos to pos + qreal bottomlineY; // vertical offset of dockpos to pos int thickness_start; // for StylePoly* LinkStyle style; // Current style LinkPos linkpos; // Link at bottom of object or middle of height QColor linkcolor; // Link color - Q3CanvasLine* l; // line style - Q3CanvasPolygon* p; // poly styles + QPen pen; + QGraphicsLineItem* l; // line style + QGraphicsPolygonItem* p; // poly styles int arcsegs; // arc: number of segments - QList segment; // a part of e.g. the parabel - Q3PointArray pa0; // For drawing of PolyParabel and PolyLine - Q3PointArray pa1; // For drawing of PolyParabel - Q3PointArray pa2; // For drawing of PolyParabel - Q3CanvasLine* bottomline; // on bottom of BBox + QList segment; // a part of e.g. the parabel + QPolygonF pa0; // For drawing of PolyParabel and PolyLine + QPolygonF pa1; // For drawing of PolyParabel + QPolygonF pa2; // For drawing of PolyParabel + QGraphicsLineItem* bottomline; // on bottom of BBox bool repositionRequest; // bool selected; // Used for marking the selection bool hideLinkUnselected; // to hide links if unselected - Q3CanvasRectangle* selbox; + QGraphicsRectItem* selbox; FrameObj *frame; // frame around object - int topPad, botPad, + qreal topPad, botPad, leftPad, rightPad; // padding within bbox - QPoint relPos; // position relative to childPos of parent + QPointF relPos; // position relative to childPos of parent bool useRelPos; bool useOrientation; };