Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
symbol.h
1/*
2 * Copyright (C) 2019-2025 Andrés Martínez Mera - andresmmera@protonmail.com
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef SYMBOL_H
19#define SYMBOL_H
20
21#include <QGraphicsItem>
22#include <QList>
23#include <QMessageBox>
24
25class Wire;
26class GraphWidget;
27QT_BEGIN_NAMESPACE
28class QGraphicsSceneMouseEvent;
29QT_END_NAMESPACE
30
34class Symbol : public QGraphicsObject {
35public:
36
41
47 virtual void addWire(Wire* Wire) = 0;
48
54 virtual QRectF boundingRect() const = 0;
55
61 virtual QPainterPath shape() const = 0;
62
68 virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
69 QWidget* widget) = 0;
70
76 virtual QPoint getPortLocation(int) = 0;
77
78protected:
79
85 virtual QVariant itemChange(GraphicsItemChange change,
86 const QVariant& value) = 0;
87
93 virtual void mousePressEvent(QGraphicsSceneMouseEvent* event) = 0;
94
100 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) = 0;
101};
102
103#endif
Definition graphwidget.h:28
Abstract base class for schematic symbols.
Definition symbol.h:34
virtual void addWire(Wire *Wire)=0
Add wire connection to symbol.
virtual QPainterPath shape() const =0
Get symbol selection shape.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0
Paint symbol on scene.
virtual QPoint getPortLocation(int)=0
Get port location in symbol coordinates.
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)=0
Handle mouse press events.
Symbol()
Class constructor.
Definition symbol.h:40
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)=0
Handle item change events.
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)=0
Handle mouse release events.
virtual QRectF boundingRect() const =0
Get symbol bounding rectangle.
Wire connection between symbols.
Definition wire.h:21