umbrello: umbrello/umlwidgets/pinportbase.h Source File

umbrello 25.08.0 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

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
13class FloatingTextWidget;
14class ChildWidgetPlacement;
15
22 class PinPortBase : public UMLWidget
23{
24 Q_OBJECT
25public:
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
55public Q_SLOTS:
56 virtual void slotMenuSelection(QAction* action);
57
58protected:
59 void init(UMLWidget *owner = nullptr);
60 bool activate(IDChangeLog *changeLog = nullptr);
61
62private:
63 ChildWidgetPlacement* createPlacement(WidgetBase::WidgetType type);
64
65protected:
66 FloatingTextWidget *m_pName;
67
68private:
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::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::PinPortBase
PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o)
Definition pinportbase.cpp:32
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:65
UMLWidget::init
void init()
Definition umlwidget.cpp:706
UMLWidget::UMLWidget
UMLWidget(UMLScene *scene, WidgetType type=wt_UMLWidget, UMLObject *o=nullptr)
Definition umlwidget.cpp:86
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