QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
conductortextitem.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef CONDUCTOR_TEXT_ITEM_H
19#define CONDUCTOR_TEXT_ITEM_H
20#include "diagramtextitem.h"
21class Conductor;
30{
31 Q_OBJECT
32
33 // constructors, destructor
34 public:
35 ConductorTextItem(Conductor * = nullptr);
36 ConductorTextItem(const QString &, Conductor * = nullptr);
37 ~ConductorTextItem() override;
38 private:
40
41 public:
42 enum { Type = UserType + 1006 };
44 void fromXml(const QDomElement &) override;
45 int type() const override { return Type; }
46 virtual bool wasMovedByUser() const;
47 virtual bool wasRotateByUser() const;
48 virtual void forceMovedByUser(bool);
49 virtual void forceRotateByUser(bool);
50 virtual void setPos(const QPointF &pos);
51 virtual void setPos(qreal x, qreal y);
52
53 protected:
54 void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
55 void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override;
56 void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override;
57 void hoverEnterEvent(QGraphicsSceneHoverEvent *) override;
58 void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override;
59 void hoverMoveEvent(QGraphicsSceneHoverEvent *) override;
60
61 // attributes
62 private:
67};
68#endif
Definition conductor.h:43
Definition conductortextitem.h:30
bool rotate_by_user_
Definition conductortextitem.h:65
ConductorTextItem(const ConductorTextItem &)
int type() const override
Definition conductortextitem.h:45
~ConductorTextItem() override
Definition conductortextitem.cpp:53
@ Type
Definition conductortextitem.h:42
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
Definition conductortextitem.cpp:251
void hoverMoveEvent(QGraphicsSceneHoverEvent *) override
Definition conductortextitem.cpp:262
QPointF before_mov_pos_
Definition conductortextitem.h:66
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
ConductorTextItem::mouseReleaseEvent.
Definition conductortextitem.cpp:204
virtual bool wasRotateByUser() const
ConductorTextItem::wasRotateByUser.
Definition conductortextitem.cpp:96
bool moved_by_user_
Definition conductortextitem.h:64
virtual void setPos(const QPointF &pos)
ConductorTextItem::setPos.
Definition conductortextitem.cpp:135
virtual void forceMovedByUser(bool)
Definition conductortextitem.cpp:106
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
ConductorTextItem::mouseMoveEvent.
Definition conductortextitem.cpp:179
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
Definition conductortextitem.cpp:237
virtual bool wasMovedByUser() const
Definition conductortextitem.cpp:87
Conductor * parentConductor() const
Definition conductortextitem.cpp:61
Conductor * parent_conductor_
Definition conductortextitem.h:63
void fromXml(const QDomElement &) override
ConductorTextItem::fromXml Read the properties stored in the xml element given in parameter.
Definition conductortextitem.cpp:71
virtual void forceRotateByUser(bool)
ConductorTextItem::forceRotateByUser.
Definition conductortextitem.cpp:122
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
ConductorTextItem::mousePressEvent.
Definition conductortextitem.cpp:170
Definition diagramtextitem.h:34