umbrello 26.03.70-f7b1fd3 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

floatingdashlinewidget.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef FLOATINGDASHLINEWIDGET_H
7#define FLOATINGDASHLINEWIDGET_H
8
9#include "umlwidget.h"
10 class CombinedFragmentWidget;
11
12#define FLOATING_DASH_LINE_MARGIN 25
13#define FLOATING_DASH_LINE_TEXT_MARGIN 5
14
15/* how many pixels a user could click around a point */
16#define POINT_DELTA 5
17
28 class FloatingDashLineWidget : public UMLWidget
29{
30 Q_OBJECT
31 public:
32 explicit FloatingDashLineWidget(UMLScene *scene, Uml::ID::Type id = Uml::ID::None, CombinedFragmentWidget *parent = nullptr);
33 ~FloatingDashLineWidget();
34
35 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option = nullptr, QWidget *widget = nullptr);
36
37 void slotMenuSelection(QAction* action);
38
39 bool onLine(const QPointF& point);
40
41 void setText(const QString& text);
42
43 void setY(qreal y);
44 void setYMin(qreal yMin);
45 void setYMax(qreal yMax);
46 qreal getYMin() const;
47 qreal getDiffY() const;
48
49 void saveToXMI(QXmlStreamWriter& writer);
50 bool loadFromXMI(QDomElement & qElement);
51
52 private:
56 QString m_text;
57
62 qreal m_yMin;
63
68 qreal m_yMax;
69 CombinedFragmentWidget *m_parent;
70};
71
72#endif
CombinedFragmentWidget
A graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:28
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:29
FloatingDashLineWidget::m_yMin
qreal m_yMin
Definition: floatingdashlinewidget.h:62
FloatingDashLineWidget::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition: floatingdashlinewidget.cpp:158
FloatingDashLineWidget::m_text
QString m_text
Definition: floatingdashlinewidget.h:56
FloatingDashLineWidget::setY
void setY(qreal y)
Definition: floatingdashlinewidget.cpp:117
FloatingDashLineWidget::~FloatingDashLineWidget
~FloatingDashLineWidget()
Definition: floatingdashlinewidget.cpp:47
FloatingDashLineWidget::getDiffY
qreal getDiffY() const
Definition: floatingdashlinewidget.cpp:150
FloatingDashLineWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option=nullptr, QWidget *widget=nullptr)
Definition: floatingdashlinewidget.cpp:56
FloatingDashLineWidget::setYMin
void setYMin(qreal yMin)
Definition: floatingdashlinewidget.cpp:126
FloatingDashLineWidget::m_parent
CombinedFragmentWidget * m_parent
Definition: floatingdashlinewidget.h:69
FloatingDashLineWidget::loadFromXMI
bool loadFromXMI(QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:172
FloatingDashLineWidget::m_yMax
qreal m_yMax
Definition: floatingdashlinewidget.h:68
FloatingDashLineWidget::getYMin
qreal getYMin() const
Definition: floatingdashlinewidget.cpp:142
FloatingDashLineWidget::onLine
bool onLine(const QPointF &point)
Definition: floatingdashlinewidget.cpp:85
FloatingDashLineWidget::setYMax
void setYMax(qreal yMax)
Definition: floatingdashlinewidget.cpp:134
FloatingDashLineWidget::setText
void setText(const QString &text)
Definition: floatingdashlinewidget.cpp:77
UMLScene
Definition: umlscene.h:66
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:36
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:792
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