Init
This commit is contained in:
68
graphicslineitem.h
Normal file
68
graphicslineitem.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef GRAPHICSLINEITEM_H
|
||||
#define GRAPHICSLINEITEM_H
|
||||
|
||||
#include <QGraphicsLineItem>
|
||||
#include <QPainter>
|
||||
#include <cmath>
|
||||
|
||||
struct T_txtAttr
|
||||
{
|
||||
QString txt;
|
||||
QColor col;
|
||||
QPointF pos;
|
||||
qreal size;
|
||||
};
|
||||
|
||||
class graphicsLineItem : public QGraphicsLineItem
|
||||
{
|
||||
|
||||
public:
|
||||
graphicsLineItem(QObject *parent = 0);
|
||||
|
||||
QRectF boundingRect() const;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
void setColor(QColor c);
|
||||
QColor color() {return col;}
|
||||
QPointF pos0();
|
||||
QPointF pos1();
|
||||
void setPos0(QPointF p);
|
||||
void setPos0(qreal a, qreal b) {setPos0(QPointF(a, b));}
|
||||
void setPos0(int a, int b) {setPos0(qreal(a), qreal(b));}
|
||||
|
||||
void setPos1(QPointF p);
|
||||
void setPos1(qreal a, qreal b) {setPos1(QPointF(a, b));}
|
||||
void setPos1(int a, int b) {setPos1(qreal(a), qreal(b));}
|
||||
|
||||
qreal length();
|
||||
void setLength(qreal l);
|
||||
void setAngle(qreal a);
|
||||
void setGlobalAngle(qreal a);
|
||||
void setWidth(qreal w);
|
||||
|
||||
QString getText(int d=0) ;
|
||||
QPointF getTextPos(int d=0);
|
||||
QColor getTextColor(int d=0);
|
||||
qreal getTextSize(int d=0);
|
||||
|
||||
void setText(QString s, int d=0);
|
||||
void setTextPos(QPointF p, int d=0);
|
||||
void setTextColor(QColor c, int d =0);
|
||||
void setTextSize(qreal s, int d = 0);
|
||||
|
||||
void setCircles(bool f1, bool f2);
|
||||
|
||||
|
||||
private:
|
||||
qreal x0,x1,y0,y1;
|
||||
QColor col;
|
||||
qreal wid;
|
||||
|
||||
T_txtAttr str[2];
|
||||
|
||||
int drawCircles;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // GRAPHICSLINEITEM_H
|
||||
Reference in New Issue
Block a user