Terminal strip item can be added to diagram

Initial commit about graphics item of a terminal strip, Work in
progress.
This commit is contained in:
joshua
2022-08-27 21:24:25 +02:00
parent d9a0b03e23
commit ff80453f2c
13 changed files with 751 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
Copyright 2006-2021 The QElectroTech Team
This file is part of QElectroTech.
@@ -42,6 +42,8 @@ class QetGraphicsItem : public QGraphicsObject
{return is_movable_;}
virtual void setMovable (bool movable) { is_movable_ = movable;}
bool isHovered() const;
virtual void editProperty () {}
virtual QString name ()const
{return QString("");}
@@ -54,6 +56,8 @@ class QetGraphicsItem : public QGraphicsObject
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
protected:
bool is_movable_;
@@ -62,6 +66,9 @@ class QetGraphicsItem : public QGraphicsObject
QPointF m_mouse_to_origin_movement;
QET::GraphicsItemState m_state = QET:: GIOK;
private:
bool m_hovered{false};
};
#endif // QETGRAPHICSITEM_H