Basic Shape: qgraphicsitem_cast<> instead of dynamic_cast

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2897 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
abhishekm71
2014-03-02 13:49:11 +00:00
parent 578cda387b
commit d80a2289d6
4 changed files with 17 additions and 4 deletions

View File

@@ -16,6 +16,19 @@ class QetShapeItem : public QetGraphicsItem
QetShapeItem(QPointF, QPointF = QPointF(0,0), ShapeType = Line, bool lineAngle = false, QGraphicsItem *parent = 0);
virtual ~QetShapeItem();
// attributes
public:
enum { Type = UserType + 1008 };
// methods
public:
/**
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
QetShapeItem
@return the QGraphicsItem type
*/
virtual int type() const { return Type; }
void setStyle(Qt::PenStyle);
Qt::PenStyle getStyle() const { return _shapeStyle; }
ShapeType getType() const { return _shapeType; }