Implemented a primitive decorator, allowing groups of primitives to be easily resized.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2027 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2013-02-08 22:05:15 +00:00
parent 73fa01c7b9
commit 2bed00fd25
21 changed files with 1566 additions and 124 deletions

View File

@@ -21,8 +21,10 @@
#include <QtXml>
#include <QImage>
class CustomElement;
class QETElementEditor;
class ElementPrimitiveDecorator;
class ElementScene;
class QETElementEditor;
/**
This abstract class represents a primitive of the visual representation of an
electrical element. The Element, FixedElement and CustomElement classes do not
@@ -95,6 +97,14 @@ class CustomElementPart {
/// @return the name that will be used as XML tag when exporting the primitive
virtual QString xmlName() const = 0;
virtual QGraphicsItem *toItem();
virtual void setDecorator(ElementPrimitiveDecorator *);
virtual bool singleItemPressEvent(ElementPrimitiveDecorator *, QGraphicsSceneMouseEvent *);
virtual bool singleItemMoveEvent(ElementPrimitiveDecorator *, QGraphicsSceneMouseEvent *);
virtual bool singleItemReleaseEvent(ElementPrimitiveDecorator *, QGraphicsSceneMouseEvent *);
virtual bool singleItemDoubleClickEvent(ElementPrimitiveDecorator *, QGraphicsSceneMouseEvent *);
protected:
QList<QPointF> mapPoints(const QRectF &, const QRectF &, const QList<QPointF> &);
};