// QTreeArrow: a custom QCanvasBezierCurve gizmo. Implemented from
// scratch and provides no collision detection.
class QTreeArrow : public QCanvasItem
{
public:
QTreeArrow::QTreeArrow( QTreeRevBall* source, QTreeRevBall* target,
FLCArrowType type, Contrib contrib );
virtual QTreeArrow::~QTreeArrow();
// The following methods are all abstract QCanvasItem methods.
// Draw a bezier curve-shaped arrow from source to target.
void draw( QPainter& p );
// The bounding rectangle is valid but very optimistic.
QRect boundingRect() const;
// No real collision detection possible with this implementation.
virtual bool collidesWith( const QCanvasItem* other )
const { return false; };
virtual bool collidesWith
(
const QCanvasSprite*,
const QCanvasPolygonalItem*,
const QCanvasRectangle*,
const QCanvasEllipse*,
const QCanvasText*
) const { return false; };
// Update the pen based on available data.
void UpdatePen();
private:
QPoint start, end;
QColor mycolor;
QPen mypen;
FLCArrowType atype;
Contrib acontrib;
};