mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-31 07:29:58 +02:00
Basic Primitive shapes added (line,rectangle,ellipse). Default style dashed.
Pending work: 1. DXF Export 2. XML Import / Export 3. Properties Edit option (line style/colour/weight) 4. Debugging required git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2873 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
35
sources/qetgraphicsitem/qetshapeitem.h
Normal file
35
sources/qetgraphicsitem/qetshapeitem.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef QETSHAPEITEM_H
|
||||
#define QETSHAPEITEM_H
|
||||
|
||||
#include "qetgraphicsitem.h"
|
||||
|
||||
class QetShapeItem : public QetGraphicsItem
|
||||
{
|
||||
public:
|
||||
|
||||
enum ShapeType {
|
||||
Line,
|
||||
Rectangle,
|
||||
Ellipse
|
||||
};
|
||||
|
||||
QetShapeItem(QPointF, QPointF, ShapeType, bool lineAngle = false, QGraphicsItem *parent = 0);
|
||||
virtual ~QetShapeItem();
|
||||
|
||||
private:
|
||||
ShapeType _shapeType;
|
||||
Qt::PenStyle _shapeStyle;
|
||||
QRectF _boundingRect;
|
||||
bool _lineAngle; // false if line from topleft corner to bottomright corner
|
||||
// and true if line from topright corner to bottomleft corner
|
||||
|
||||
void setStyle(Qt::PenStyle);
|
||||
virtual void editProperty() {}
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
QRectF boundingRect() const;
|
||||
|
||||
};
|
||||
|
||||
#endif // QETSHAPEITEM_H
|
||||
Reference in New Issue
Block a user