umbrello 26.03.70-1a62d36 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

pinportbase.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2014-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef PINPORTBASE_H
7#define PINPORTBASE_H
8
9#include "umlwidget.h"
10
11#include <QScopedPointer>
12
13 class FloatingTextWidget;
14 class ChildWidgetPlacement;
15
22 class PinPortBase : public UMLWidget
23{
24 Q_OBJECT
25 public:
26 PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o);
27 PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner = nullptr, Uml::ID::Type id = Uml::ID::None);
28 virtual ~PinPortBase();
29
30 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
31 virtual QRectF boundingRect() const;
32
33 virtual UMLWidget* ownerWidget() const;
34
35 void setInitialPosition(const QPointF &scenePos);
36
37 qreal getX() const;
38 qreal getY() const;
39 QPointF getPos() const;
40
41 void updateWidget();
42 void setName(const QString &strName);
43 void moveWidgetBy(qreal diffX, qreal diffY);
44 virtual void notifyParentResize();
45
46 UMLWidget* onWidget(const QPointF& p);
47 UMLWidget* widgetWithID(Uml::ID::Type id);
48
49 FloatingTextWidget *floatingTextWidget();
50 void setFloatingTextWidget(FloatingTextWidget *ft);
51
52 void saveToXMI(QXmlStreamWriter& writer);
53 bool loadFromXMI(QDomElement& qElement);
54
55 public Q_SLOTS:
56 virtual void slotMenuSelection(QAction* action);
57
58 protected:
59 void init(UMLWidget *owner = nullptr);
60 bool activate(IDChangeLog *changeLog = nullptr);
61
62 private:
63 ChildWidgetPlacement* createPlacement(WidgetBase::WidgetType type);
64
65 protected:
66 FloatingTextWidget *m_pName;
67
68 private:
69 QScopedPointer<ChildWidgetPlacement> m_childPlacement;
70};
71
72#endif
ChildWidgetPlacement
Base class for child widget placement.
Definition: childwidgetplacement.h:22
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:32
IDChangeLog
Definition: idchangelog.h:22
PinPortBase
Abstract base class for PinWidget and PortWidget.
Definition: pinportbase.h:23
PinPortBase::widgetWithID
UMLWidget * widgetWithID(Uml::ID::Type id)
Definition: pinportbase.cpp:274
PinPortBase::m_childPlacement
QScopedPointer< ChildWidgetPlacement > m_childPlacement
Definition: pinportbase.h:69
PinPortBase::~PinPortBase
virtual ~PinPortBase()
Definition: pinportbase.cpp:49
PinPortBase::setInitialPosition
void setInitialPosition(const QPointF &scenePos)
Definition: pinportbase.cpp:90
PinPortBase::ownerWidget
virtual UMLWidget * ownerWidget() const
Definition: pinportbase.cpp:85
PinPortBase::createPlacement
ChildWidgetPlacement * createPlacement(WidgetBase::WidgetType type)
Definition: pinportbase.cpp:53
PinPortBase::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)
Definition: pinportbase.cpp:166
PinPortBase::onWidget
UMLWidget * onWidget(const QPointF &p)
Definition: pinportbase.cpp:256
PinPortBase::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: pinportbase.cpp:188
PinPortBase::floatingTextWidget
FloatingTextWidget * floatingTextWidget()
Definition: pinportbase.cpp:237
PinPortBase::loadFromXMI
bool loadFromXMI(QDomElement &qElement)
Definition: pinportbase.cpp:304
PinPortBase::getPos
QPointF getPos() const
Definition: pinportbase.cpp:105
PinPortBase::setName
void setName(const QString &strName)
Definition: pinportbase.cpp:130
PinPortBase::getY
qreal getY() const
Definition: pinportbase.cpp:100
PinPortBase::moveWidgetBy
void moveWidgetBy(qreal diffX, qreal diffY)
Definition: pinportbase.cpp:149
PinPortBase::setFloatingTextWidget
void setFloatingTextWidget(FloatingTextWidget *ft)
Definition: pinportbase.cpp:241
PinPortBase::boundingRect
virtual QRectF boundingRect() const
Definition: pinportbase.cpp:180
PinPortBase::getX
qreal getX() const
Definition: pinportbase.cpp:95
PinPortBase::updateWidget
void updateWidget()
Definition: pinportbase.cpp:116
PinPortBase::notifyParentResize
virtual void notifyParentResize()
Definition: pinportbase.cpp:158
PinPortBase::activate
bool activate(IDChangeLog *changeLog=nullptr)
Definition: pinportbase.cpp:346
PinPortBase::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition: pinportbase.cpp:287
PinPortBase::m_pName
FloatingTextWidget * m_pName
Definition: pinportbase.h:66
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLScene
Definition: umlscene.h:66
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:36
UMLWidget::init
void init()
Definition: umlwidget.cpp:722
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:107
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:373
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
umlwidget.h