18 #ifndef SCALEBARITEM_H 19 #define SCALEBARITEM_H 21 #include <QGraphicsItem> 22 #include <QTextDocument> 33 enum {Type = UserType + ScaleBar
50 ScaleBarItem(
double x0 = 0,
double y0 = 0,
unsigned color = 0,
52 const QString& text =
"",
bool visible =
true,
53 bool vertical =
false,
double relSize = 1);
65 ScaleBarItem(
const KConfigGroup* plo,
unsigned color = 0,
72 inline double length()
const {
return m_length; };
82 inline void setLength(
double length) { m_length = length; };
99 inline void setVertical(
bool vertical) { m_vertical = vertical; };
103 virtual int type()
const {
return Type; };
107 inline bool vertical()
const {
return m_vertical; };
112 void writePlo(KConfigGroup* plo)
const;
120 void setProperties();
124 double m_length, l2, wRel;
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
virtual int type() const
Returns specific QGraphicsItem type number.
Definition: scalebaritem.h:103
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0
void writePlo(KConfigGroup *plo, bool visible) const
Writes into plot file.
void update(const QRectF &rect)
Scale bar item class.
Definition: scalebaritem.h:29
void setVertical(bool vertical)
Sets orientation.
Definition: scalebaritem.h:99
bool vertical() const
Returns true for vertical, false for horizontal orientation.
Definition: scalebaritem.h:107
void setLength(double length)
Sets length.
Definition: scalebaritem.h:82
static QPixmap pixmap(Symbol symbol)
Returns black decoration pixmap of plot symbol for use in dialog GUI.
virtual QRectF boundingRect() const =0
Decoration item class.
Definition: decoitem.h:35
QString text() const
Returns text.
Definition: scalebaritem.h:101
void setText(const QString &text)
Sets text.
Definition: scalebaritem.h:94
double length() const
Returns length in cm.
Definition: scalebaritem.h:72