mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-25 05:59:58 +02:00
Element text item group : Add new property for edit the adjustment of the space between texts
Dynamic element text item editor : Add new entry for edit the alignment, rotation and vertical adjustment of a group Element Mover : Minor, remove the group texts from the moved content git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5165 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -36,7 +36,15 @@ class ElementTextItemGroup : public QObject, public QGraphicsItemGroup
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QPointF pos READ pos WRITE setPos)
|
||||
Q_PROPERTY(qreal rotation READ rotation WRITE setRotation)
|
||||
Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
|
||||
Q_PROPERTY(int verticalAdjustment READ verticalAdjustment WRITE setVerticalAdjustment NOTIFY verticalAdjustmentChanged)
|
||||
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
|
||||
|
||||
public:
|
||||
signals:
|
||||
void rotationChanged(qreal);
|
||||
void verticalAdjustmentChanged(int);
|
||||
void alignmentChanged(Qt::Alignment);
|
||||
|
||||
public:
|
||||
ElementTextItemGroup(const QString &name, Element *parent);
|
||||
@@ -47,6 +55,8 @@ class ElementTextItemGroup : public QObject, public QGraphicsItemGroup
|
||||
void setAlignment(Qt::Alignment alignement);
|
||||
Qt::Alignment alignment() const;
|
||||
void updateAlignment();
|
||||
int verticalAdjustment() const {return m_vertical_adjustment;}
|
||||
void setVerticalAdjustment(int v);
|
||||
void setName(QString name);
|
||||
QString name() const {return m_name;}
|
||||
QList<DynamicElementTextItem *> texts() const;
|
||||
@@ -59,6 +69,7 @@ class ElementTextItemGroup : public QObject, public QGraphicsItemGroup
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
QRectF boundingRect() const override;
|
||||
void setRotation(qreal angle);
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
@@ -71,6 +82,7 @@ class ElementTextItemGroup : public QObject, public QGraphicsItemGroup
|
||||
QString m_name;
|
||||
bool m_first_move = true;
|
||||
QPointF m_mouse_to_origin_movement;
|
||||
int m_vertical_adjustment = 0;
|
||||
};
|
||||
|
||||
#endif // ELEMENTTEXTITEMGROUP_H
|
||||
|
||||
Reference in New Issue
Block a user