21#include <QGraphicsRectItem>
32 enum {Type = UserType + Rectangle
49 RectItem(
double x0 = 0,
double y0 = 0,
unsigned color = 0,
50 QGraphicsItem* parent =
nullptr,
double width = 3,
double height = 2,
51 bool visible =
true,
FillStyle fillStyle = NoBrush,
52 Symbol symbol = SolidLine,
double relSize = 1,
double dir = 0);
64 RectItem(
const KConfigGroup* plo,
unsigned color = 0,
65 QGraphicsItem* parent =
nullptr);
69 inline double dir()
const {
return m_dir; };
73 inline double height()
const {
return m_height; };
80 inline void setDir(
double dir) { m_dir = dir; };
90 inline void setHeight(
double height) { m_height = height; };
107 inline void setWidth(
double width) { m_width = width; };
111 virtual int type()
const override {
return Type; };
115 inline double width()
const {
return m_width; };
128 double m_width, m_height, m_dir;
Decoration item class.
Definition decoitem.h:36
FillStyle
Fill styles.
Definition kplitem.h:45
Symbol
Symbol types.
Definition kplitem.h:83
Rectangle item class.
Definition rectitem.h:29
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Updates position.
void setHeight(double height)
Sets height.
Definition rectitem.h:90
void update()
Applies changes and forces redrawing.
void writePlo(KConfigGroup *plo) const
Writes into plot file.
Symbol symbol() const
Returns line type.
Definition rectitem.h:109
RectItem(const RectItem &a)
Copy constructor.
void setDir(double dir)
Sets rotation angle.
Definition rectitem.h:80
double dir() const
Returns rotation angle in deg.
Definition rectitem.h:69
RectItem(double x0=0, double y0=0, unsigned color=0, QGraphicsItem *parent=nullptr, double width=3, double height=2, bool visible=true, FillStyle fillStyle=NoBrush, Symbol symbol=SolidLine, double relSize=1, double dir=0)
Constructor.
void setPenWidth()
Sets pen width.
void setSymbol(Symbol symbol)
Sets line type.
Definition rectitem.h:102
FillStyle fillStyle() const
Returns fill style.
Definition rectitem.h:71
void setWidth(double width)
Sets width.
Definition rectitem.h:107
void setProperties()
Sets properties according to transformation matrix.
void setFillStyle(FillStyle style)
Sets fill style.
Definition rectitem.h:85
virtual int type() const override
Returns specific QGraphicsItem type number.
Definition rectitem.h:111
QPixmap pixmap() const
Returns decoration pixmap for item list.
double width() const
Returns width in cm.
Definition rectitem.h:115
RectItem(const KConfigGroup *plo, unsigned color=0, QGraphicsItem *parent=nullptr)
Constructor.
double height() const
Returns height in cm.
Definition rectitem.h:73
virtual ~RectItem()
Destructor.
void setProperties(const QTransform &m)
Sets properties according to transformation matrix.