Schim
rect.h
1 #ifndef RECT_H
2 #define RECT_H
3 
4 #include "object.h"
5 
6 #include <QRectF>
7 
14 class Rect : public Object, public QRectF
15 {
16 public:
17  // CONSTRUCTORS
21  Rect();
25  Rect(qreal x, qreal y, qreal width, qreal height);
29  Rect(const Rect &rect);
30  Object *clone() const override;
31 
32  // GETTERS
33  QPointF getPos() const override;
34  float getLinewidth() const;
35  QString getProperty(const QString &name) const override;
36 
37  // SETTERS
38  void setPos(const QPointF &pos) override;
39  void setLinewidth(float lw);
40  void setProperty(const QString &name, const QString &value) override;
41 
42  // OPERATORS
43  bool operator==(const Rect &obj) const;
44  bool operator!=(const Rect &obj) const;
45 
46 private:
47  // ATTRIBUTES
49  float linewidth = 0.5;
50 };
51 
52 #endif // RECT_H
The abstract base class for all objects in a sheet.
Definition: object.h:21
Rect()
Construct a null rectangle.
A visual rectangle object.
Definition: rect.h:14
void setPos(const QPointF &pos) override
Set the position of the object in the sheet.
QPointF getPos() const override
Return the position of the object in the sheet.