umbrello  2.35.0
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
notewidget.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 NOTEWIDGET_H
7 #define NOTEWIDGET_H
8 
9 //app includes
10 #include "umlwidget.h"
11 
12 // Qt forward declarations
13 class QPainter;
14 
25 class NoteWidget : public UMLWidget
26 {
27  Q_OBJECT
28 public:
29 
31  enum NoteType
32  {
37  };
38 
41  virtual ~NoteWidget();
42 
43  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
44 
45  static NoteType stringToNoteType(const QString& noteType);
46 
47  NoteType noteType() const;
49  void setNoteType(const QString& noteType);
50 
51  Uml::ID::Type diagramLink() const;
52  void setDiagramLink(Uml::ID::Type viewID);
53  bool setDiagramLink(const QString &diagramName);
54 
55  void askForNoteType(UMLWidget* &targetWidget);
56 
57  virtual bool showPropertiesDialog();
58 
59  virtual bool loadFromXMI(QDomElement & qElement);
60  virtual void saveToXMI(QXmlStreamWriter& writer);
61  virtual QSizeF minimumSize() const;
62 
63  static QPointer<NoteWidget> s_pCurrentNote;
64 
65 public Q_SLOTS:
66  void slotMenuSelection(QAction* action);
67 
68 protected:
69  virtual QSizeF calculateSize(bool withExtensions = true) const;
70  void paintText(QPainter *painter);
71  void paintTextWordWrap(QPainter *painter);
72  virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
73 
74 private:
77 };
78 
79 #endif
notewidget.h
UMLWidget::height
qreal height() const
Definition: umlwidget.h:112
NoteWidget::paintTextWordWrap
void paintTextWordWrap(QPainter *painter)
Definition: notewidget.cpp:433
WidgetBase::textColor
QColor textColor() const
Definition: widgetbase.cpp:347
NoteDialog
Definition: notedialog.h:17
ListPopupMenu::mt_Properties
@ mt_Properties
Definition: listpopupmenu.h:177
NoteWidget::PreCondition
@ PreCondition
Definition: notewidget.h:34
docwindow.h
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:35
WidgetBase::setDocumentation
virtual void setDocumentation(const QString &doc)
Definition: widgetbase.cpp:306
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1398
UMLWidget::FT_NORMAL
@ FT_NORMAL
Definition: umlwidget.h:218
WidgetBase::umlScene
UMLScene * umlScene() const
Definition: widgetbase.cpp:174
WidgetBase::useFillColor
bool useFillColor() const
Definition: widgetbase.cpp:431
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:135
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:373
NoteWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: notewidget.cpp:64
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:63
UMLWidget::cleanup
virtual void cleanup()
Definition: umlwidget.cpp:1792
NoteWidget::NoteWidget
NoteWidget(UMLScene *scene, NoteWidget::NoteType noteType=Normal, Uml::ID::Type id=Uml::ID::None)
Definition: notewidget.cpp:46
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1306
logError1
#define logError1(s, a)
Definition: uml.h:545
DocWindow::updateDocumentation
void updateDocumentation(bool clear=false, bool startup=false)
Definition: docwindow.cpp:268
UMLWidget::loadFromXMI
virtual bool loadFromXMI(QDomElement &qElement)
Definition: umlwidget.cpp:2210
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
NoteWidget::calculateSize
virtual QSizeF calculateSize(bool withExtensions=true) const
Definition: notewidget.cpp:331
NoteWidget::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Definition: notewidget.cpp:527
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:2038
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1311
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:555
NoteWidget::minimumSize
virtual QSizeF minimumSize() const
Definition: notewidget.cpp:321
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:389
UMLDoc::changeCurrentView
void changeCurrentView(Uml::ID::Type id)
Definition: umldoc.cpp:1832
NoteWidget::s_pCurrentNote
static QPointer< NoteWidget > s_pCurrentNote
Definition: notewidget.h:63
Uml::DiagramType::fromInt
Enum fromInt(int item)
Definition: basictypes.cpp:255
UMLView
Definition: umlview.h:29
NoteWidget::askForNoteType
void askForNoteType(UMLWidget *&targetWidget)
Definition: notewidget.cpp:222
UMLApp::docWindow
DocWindow * docWindow() const
Definition: uml.cpp:1995
NoteWidget::Transformation
@ Transformation
Definition: notewidget.h:36
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Library General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: LGPL-2.0-only.txt:368
NoteWidget::stringToNoteType
static NoteType stringToNoteType(const QString &noteType)
Definition: notewidget.cpp:126
NoteWidget::loadFromXMI
virtual bool loadFromXMI(QDomElement &qElement)
Definition: notewidget.cpp:250
umlwidget.h
UMLWidget::defaultMargin
static const int defaultMargin
Definition: umlwidget.h:44
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:38
UMLWidget::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: umlwidget.cpp:2188
i18n
#define i18n
Definition: main.cpp:35
Uml::DiagramType::N_DIAGRAMTYPES
@ N_DIAGRAMTYPES
Definition: basictypes.h:77
WidgetBase::documentation
QString documentation() const
Definition: widgetbase.cpp:281
WidgetBase::asNoteWidget
NoteWidget * asNoteWidget()
Definition: widgetbase.cpp:1502
NoteWidget::setDiagramLink
void setDiagramLink(Uml::ID::Type viewID)
Definition: notewidget.cpp:171
NoteWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: notewidget.cpp:303
c
type show c for details The hypothetical commands show w and show c should show the appropriate parts of the General Public License Of the commands you use may be called something other than show w and show c
Definition: GPL-2.0-only.txt:301
NoteWidget::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: notewidget.cpp:267
NoteWidget
Displays a note box.
Definition: notewidget.h:25
NoteWidget::~NoteWidget
virtual ~NoteWidget()
Definition: notewidget.cpp:57
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:349
widget_utils.h
UMLDoc
Definition: umldoc.h:69
UMLDoc::setModified
void setModified(bool modified=true)
Definition: umldoc.cpp:3195
NoteWidget::setNoteType
void setNoteType(NoteType noteType)
Definition: notewidget.cpp:141
Widget_Utils::adornStereo
QString adornStereo(QString name, bool appendSpace)
Definition: widget_utils.cpp:1069
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:100
Uml
Definition: basictypes.cpp:22
NoteWidget::paintText
void paintText(QPainter *painter)
Definition: notewidget.cpp:366
DocWindow::showDocumentation
void showDocumentation(UMLObject *object, bool overwrite=false)
Definition: docwindow.cpp:125
umlscene.h
NoteWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: notewidget.cpp:281
uml.h
NoteWidget::Normal
@ Normal
Definition: notewidget.h:33
MultiPageDialogBase::exec
int exec()
Definition: multipagedialogbase.cpp:218
debug_utils.h
notedialog.h
UMLScene::name
QString name() const
Definition: umlscene.cpp:416
NoteWidget::noteType
NoteType noteType() const
Definition: notewidget.cpp:118
UMLScene
Definition: umlscene.h:64
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:406
WidgetBase::lineWidth
uint lineWidth() const
Definition: widgetbase.cpp:410
ListPopupMenu::mt_Rename
@ mt_Rename
Definition: listpopupmenu.h:178
UMLView::umlScene
UMLScene * umlScene() const
Definition: umlview.cpp:51
listpopupmenu.h
NoteWidget::PostCondition
@ PostCondition
Definition: notewidget.h:35
Uml::ShowStereoType::None
@ None
no display of stereotype
Definition: basictypes.h:149
NoteWidget::m_noteType
NoteType m_noteType
The type of note.
Definition: notewidget.h:76
dialog_utils.h
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:448
UMLDoc::findView
UMLView * findView(Uml::ID::Type id) const
Definition: umldoc.cpp:1055
UMLWidget::width
qreal width() const
Definition: umlwidget.h:119
NoteWidget::m_diagramLink
Uml::ID::Type m_diagramLink
The diagram/scene this note links to.
Definition: notewidget.h:75
NoteWidget::NoteType
NoteType
This enum type is used to specify the type of note.
Definition: notewidget.h:31
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:775
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1139
umldoc.h
NoteWidget::diagramLink
Uml::ID::Type diagramLink() const
Definition: notewidget.cpp:160
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1958