QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
terminalstripitem.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2022 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 TERMINALSTRIPITEM_H
19#define TERMINALSTRIPITEM_H
20
21#include <QGraphicsObject>
22#include <QUuid>
23
24#include "terminalstripdrawer.h"
25#include "../../qetgraphicsitem/qetgraphicsitem.h"
26
27class TerminalStrip;
28
30{
32
33 Q_OBJECT
34
35 public:
36 TerminalStripItem(QPointer<TerminalStrip> strip, QGraphicsItem *parent = nullptr);
37 TerminalStripItem(QGraphicsItem *parent = nullptr);
38
40 QPointer<TerminalStrip> terminalStrip() const;
41
42 enum {Type = UserType + 1011};
43 int type() const override {return Type;}
44
45 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
46 QRectF boundingRect() const override;
47 QString name() const override;
48
49 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
50 void refreshPending();
51 void setLayout(QSharedPointer<TerminalStripLayoutPattern> layout);
52
53 private:
54 void setDefaultLayout();
55
56 private:
57 QPointer<TerminalStrip> m_strip;
60
61};
62
63#endif // TERMINALSTRIPITEM_H
Definition qetgraphicsitem.h:28
Definition terminalstripdrawer.h:68
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45
Definition terminalstripitem.h:30
@ Type
Definition terminalstripitem.h:42
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Definition terminalstripitem.cpp:68
QUuid m_pending_strip_uuid
Definition terminalstripitem.h:59
void setTerminalStrip(TerminalStrip *strip)
Definition terminalstripitem.cpp:48
QPointer< TerminalStrip > m_strip
Definition terminalstripitem.h:57
int type() const override
Definition terminalstripitem.h:43
void refreshPending()
Definition terminalstripitem.cpp:106
void setDefaultLayout()
Definition terminalstripitem.cpp:127
TerminalStripDrawer::TerminalStripDrawer m_drawer
Definition terminalstripitem.h:58
QRectF boundingRect() const override
Definition terminalstripitem.cpp:81
QPointer< TerminalStrip > terminalStrip() const
TerminalStripItem::terminalStrip.
Definition terminalstripitem.cpp:64
void setLayout(QSharedPointer< TerminalStripLayoutPattern > layout)
Definition terminalstripitem.cpp:122
QString name() const override
TerminalStripItem::name.
Definition terminalstripitem.cpp:93
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Definition terminalstripitem.cpp:97
Definition terminalstripitemxml.h:28