mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-17 07:29:58 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user