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

signalwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef SIGNALWIDGET_H
12 #define SIGNALWIDGET_H
13
14 #include "floatingtextwidget.h"
15 #include "linkwidget.h"
16 #include "umlwidget.h"
17 #include "worktoolbar.h"
18
19 #define SIGNAL_MARGIN 5
20 #define SIGNAL_WIDTH 45
21 #define SIGNAL_HEIGHT 15
22
27 class SignalWidget : public UMLWidget
28 {
29 Q_OBJECT
30 Q_ENUMS(SignalType)
31 public:
33 enum SignalType
34 {
35 Send = 0,
36 Accept,
37 Time
38 };
39
40 explicit SignalWidget(UMLScene * scene, SignalType signalType = Send, Uml::ID::Type id = Uml::ID::None);
41 virtual ~SignalWidget();
42
43 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
44
45 void setX(qreal newX);
46 void setY(qreal newY);
47
48 virtual void setName(const QString &strName);
49
50 SignalType signalType() const;
51 QString signalTypeStr() const;
52 void setSignalType(SignalType signalType);
53
54 virtual bool showPropertiesDialog();
55
56 void mouseMoveEvent(QGraphicsSceneMouseEvent *me);
57
58 virtual bool loadFromXMI1(QDomElement & qElement);
59 virtual void saveToXMI1(QDomDocument & qDoc, QDomElement & qElement);
60
61 public Q_SLOTS:
62 virtual void slotMenuSelection(QAction* action);
63
64 protected:
65 QSizeF minimumSize() const;
66
70 int m_oldX;
71 int m_oldY;
72
73 // Only for the time event
78 FloatingTextWidget* m_pName;
79
80 SignalType m_signalType;
81
82 protected Q_SLOTS:
83 void slotTextDestroyed();
84 };
85
86 #endif
SIGNAL_HEIGHT
#define SIGNAL_HEIGHT
Definition: signalwidget.h:21
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
SignalWidget::m_pName
FloatingTextWidget * m_pName
Definition: signalwidget.h:78
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
WidgetBase::textColor
QColor textColor() const
Definition: widgetbase.cpp:335
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase::name
QString name() const
Definition: widgetbase.cpp:309
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1392
UMLWidget::FT_NORMAL
@ FT_NORMAL
Definition: umlwidget.h:217
UMLWidget::FT_BOLD
@ FT_BOLD
Definition: umlwidget.h:218
SignalWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: signalwidget.cpp:233
WidgetBase::umlScene
UMLScene * umlScene() const
Definition: widgetbase.cpp:162
SignalWidget::m_oldX
int m_oldX
Definition: signalwidget.h:70
FloatingTextWidget::setText
void setText(const QString &t)
Definition: floatingtextwidget.cpp:109
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:132
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
SignalWidget::SignalType
SignalType
Enumeration that codes the different types of signal.
Definition: signalwidget.h:34
SignalWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: signalwidget.cpp:69
SignalWidget::Accept
@ Accept
Definition: signalwidget.h:36
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1263
SignalWidget::signalTypeStr
QString signalTypeStr() const
Definition: signalwidget.cpp:217
worktoolbar.h
SignalWidget::signalType
SignalType signalType() const
Definition: signalwidget.cpp:209
SignalWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: signalwidget.cpp:305
SignalWidget::m_oldY
int m_oldY
Definition: signalwidget.h:71
SignalWidget::setName
virtual void setName(const QString &strName)
Definition: signalwidget.cpp:189
Dialog_Utils::askName
bool askName(const QString &title, const QString &prompt, QString &name)
Definition: dialog_utils.cpp:97
SIGNAL_MARGIN
#define SIGNAL_MARGIN
Definition: signalwidget.h:19
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
SignalWidget::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *me)
Definition: signalwidget.cpp:241
ENUM_NAME
#define ENUM_NAME(o, e, v)
Definition: debug_utils.h:143
FloatingTextWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: floatingtextwidget.cpp:649
SignalWidget
Definition: signalwidget.h:28
SignalWidget::setY
void setY(qreal newY)
Definition: signalwidget.cpp:180
Uml::TextRole::Floating
@ Floating
Definition: basictypes.h:179
floatingtextwidget.h
SignalWidget::minimumSize
QSizeF minimumSize() const
Definition: signalwidget.cpp:347
UMLScene::setupNewWidget
void setupNewWidget(UMLWidget *w, bool setPosition=true)
Definition: umlscene.cpp:715
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:1936
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1268
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:543
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:377
UMLWidget::setX
virtual void setX(qreal x)
Definition: umlwidget.cpp:1685
uniqueid.h
a
QString a
Definition: petalnode.cpp:18
SIGNAL_WIDTH
#define SIGNAL_WIDTH
Definition: signalwidget.h:20
umlwidget.h
uWarning
#define uWarning()
Definition: debug_utils.h:124
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:44
i18n
#define i18n
Definition: main.cpp:39
SignalWidget::slotTextDestroyed
void slotTextDestroyed()
Definition: signalwidget.cpp:371
SignalWidget::SignalWidget
SignalWidget(UMLScene *scene, SignalType signalType=Send, Uml::ID::Type id=Uml::ID::None)
Definition: signalwidget.cpp:43
SignalWidget::~SignalWidget
virtual ~SignalWidget()
Definition: signalwidget.cpp:62
SignalWidget::m_signalType
SignalType m_signalType
Type of signal.
Definition: signalwidget.h:80
SignalWidget::Send
@ Send
Definition: signalwidget.h:35
basictypes.h
int
int int y int
Definition: cxx11-lambda-functions-and-expressions.h:4
SignalWidget::setX
void setX(qreal newX)
Definition: signalwidget.cpp:171
SignalWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: signalwidget.cpp:323
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:37
WidgetBase::m_scene
UMLScene * m_scene
Definition: widgetbase.h:316
SignalWidget::Time
@ Time
Definition: signalwidget.h:37
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
WidgetBase::useFillColor
bool useFillColor()
Definition: widgetbase.cpp:419
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:105
Uml
Definition: basictypes.cpp:37
UMLWidget::setY
virtual void setY(qreal y)
Definition: umlwidget.cpp:1697
UniqueID::gen
Uml::ID::Type gen()
Definition: uniqueid.cpp:26
Widget_Utils::findWidget
UMLWidget * findWidget(Uml::ID::Type id, const UMLWidgetList &widgets, const MessageWidgetList *messages)
Definition: widget_utils.cpp:43
SignalWidget::setSignalType
void setSignalType(SignalType signalType)
Definition: signalwidget.cpp:225
uError
#define uError()
Definition: debug_utils.h:123
uml.h
signalwidget.h
debug_utils.h
UMLScene
Definition: umlscene.h:69
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:407
UMLWidget::updateGeometry
void updateGeometry(bool withAssocs=true)
Definition: umlwidget.cpp:1781
WidgetBase::m_Doc
QString m_Doc
Only used if m_umlObject is not set.
Definition: widgetbase.h:318
ListPopupMenu::mt_Rename
@ mt_Rename
Definition: listpopupmenu.h:183
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
SignalWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: signalwidget.cpp:255
listpopupmenu.h
WidgetBase::setName
virtual void setName(const QString &strName)
Definition: widgetbase.cpp:322
dialog_utils.h
linkwidget.h
UMLWidget::mouseMoveEvent
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: umlwidget.cpp:454
FloatingTextWidget::text
QString text() const
Definition: floatingtextwidget.cpp:88
UMLWidget::width
qreal width() const
Definition: umlwidget.h:121
UMLWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlwidget.cpp:2067
WidgetBase::m_Text
QString m_Text
Definition: widgetbase.h:319
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:768
umldoc.h
WidgetBase::id
Uml::ID::Type id() const
Definition: widgetbase.cpp:214
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1869