umbrello/umbrello
umlwidget.h
Go to the documentation of this file.
49 explicit UMLWidget(UMLScene *scene, WidgetType type = wt_UMLWidget, Uml::ID::Type id = Uml::ID::None);
227 virtual void setDefaultFontMetrics(QFont &font, UMLWidget::FontType fontType, QPainter &painter);
233 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void setScene(UMLScene *scene)
Clears the selection, resets the toolbar and deselects the widget.
Definition: umlwidget.cpp:1421
Definition: umlwidget.h:218
void setStartMovePosition(const QPointF &position)
Set the start position of the move action.
Definition: umlwidget.cpp:622
void selectMultiple(QGraphicsSceneMouseEvent *me)
Selects the widget and adds it to the list of selected widgets.
Definition: umlwidget.cpp:1387
static bool widgetHasUMLObject(WidgetBase::WidgetType type)
Returns whether the widget type has an associated UMLObject.
Definition: umlwidget.cpp:1482
qreal x() const
qreal y() const
virtual QCursor resizeCursor() const
Returns the cursor to be shown when resizing the widget.
Definition: umlwidget.cpp:1186
bool m_inMoveArea
If cursor was in move/resize area when left button was pressed (and no other widgets were selected)...
Definition: umlwidget.h:332
virtual void slotTextColorChanged(Uml::ID::Type viewID)
Captures a text color change signal.
Definition: umlwidget.cpp:825
QPointF m_pressOffset
The X/Y offset from the position of the cursor when it was pressed to the upper left corner of the wi...
Definition: umlwidget.h:317
virtual void slotLineColorChanged(Uml::ID::Type viewID)
Captures a line color change signal.
Definition: umlwidget.cpp:840
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse move event.
Definition: umlwidget.cpp:468
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Draws the UMLWidget on the given paint device.
Definition: umlwidget.cpp:1636
virtual void constrain(qreal &width, qreal &height)
Apply possible constraints to the given candidate width and height.
Definition: umlwidget.cpp:681
bool wasSizeChanged()
Checks if the size of the widget changed respect to the size that it had when press event was fired...
Definition: umlwidget.cpp:1288
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse release event.
Definition: umlwidget.cpp:546
virtual void showPropertiesDialog()
Show a properties dialog for a UMLWidget.
Definition: umlwidget.cpp:1136
AssociationWidgetList & associationWidgetList()
Returns the list of associations connected to this widget.
Definition: umlwidget.h:141
This class contains all the ID translations done for each UMLObject pasted.
Definition: idchangelog.h:26
Definition: umlwidget.h:215
void setSelectionBounds()
Fills m_selectedWidgetsList and sets the selection bounds ((m_min/m_max)X/Y attributes).
Definition: umlwidget.cpp:1307
void setTextColorCmd(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:895
virtual void slotLineWidthChanged(Uml::ID::Type viewID)
Captures a linewidth change signal.
Definition: umlwidget.cpp:857
virtual void setSelected(bool _select)
Sets the state of whether the widget is selected.
Definition: umlwidget.cpp:1321
void setLineColorCmd(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:915
void moveByLocal(qreal dx, qreal dy)
Move the widget by an X and Y offset relative to the current position.
Definition: umlwidget.cpp:1155
bool m_ignoreSnapComponentSizeToGrid
Definition: umlwidget.h:309
UMLWidget(UMLScene *scene, WidgetType type=wt_UMLWidget, UMLObject *o=0)
Creates a UMLWidget object.
Definition: umlwidget.cpp:59
Definition: umlwidget.h:221
QGraphicsScene * scene() const
bool wasPositionChanged()
Checks if the position of the widget changed respect to the position that it had when press event was...
Definition: umlwidget.cpp:1299
virtual int type() const
virtual void slotMenuSelection(QAction *action)
This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMe...
Definition: umlwidget.cpp:772
QPointF m_oldPos
The X/Y position the widget had when the movement started.
Definition: umlwidget.h:320
This class represents an association inside a diagram.
Definition: associationwidget.h:50
virtual bool event(QEvent *e)
virtual UMLWidget * widgetWithID(Uml::ID::Type id)
Returns the widget with the given ID.
Definition: umlwidget.cpp:219
bool isActivated() const
Returns true if the Activate method has been called for this instance.
Definition: umlwidget.cpp:1046
bool m_activated
true if the activate function has been called for this class instance
Definition: umlwidget.h:303
virtual void updateWidget()
When a widget changes this slot captures that signal.
Definition: umlwidget.cpp:655
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Event handler for mouse double click events.
Definition: umlwidget.cpp:593
void forceUpdateFontMetrics(QPainter *painter)
Updates font metrics for widgets current m_font.
Definition: umlwidget.cpp:1747
virtual void setTextColor(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:904
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Event handler for context menu events.
Definition: umlwidget.cpp:273
virtual void setFillColor(const QColor &color)
Sets the background fill color.
Definition: umlwidget.cpp:955
bool m_shiftPressed
If shift or control button were pressed in mouse press event.
Definition: umlwidget.h:326
void selectSingle(QGraphicsSceneMouseEvent *me)
Selects the widget and clears the other selected widgets, if any.
Definition: umlwidget.cpp:1373
virtual bool activate(IDChangeLog *ChangeLog=0)
Activate the object after serializing it from a QDataStream.
Definition: umlwidget.cpp:979
void setActivated(bool active=true)
Set the m_activated flag of a widget but does not perform the Activate method.
Definition: umlwidget.cpp:1056
Definition: umlwidget.h:217
void setFontMetrics(UMLWidget::FontType fontType, QFontMetrics fm)
Set the font metric to use.
Definition: umlwidget.cpp:1709
virtual QSizeF minimumSize() const
Compute the minimum possible width and height.
Definition: umlwidget.cpp:233
virtual bool isInResizeArea(QGraphicsSceneMouseEvent *me)
Checks if the mouse is in resize area (right bottom corner), and sets the cursor depending on that...
Definition: umlwidget.cpp:1199
virtual void moveEvent(QGraphicsSceneMouseEvent *event)
Overrides the standard operation.
Definition: umlwidget.cpp:1805
QPointF startMovePosition() const
Return the start position of the move action.
Definition: umlwidget.cpp:613
void setMaximumSize(const QSizeF &size)
This method is used to set the maximum size variable for this widget.
Definition: umlwidget.cpp:265
virtual bool loadFromXMI(QDomElement &qElement)
A virtual method to load the properties of this widget from a QDomElement into this widget...
Definition: umlwidget.cpp:1833
virtual void setLineWidth(uint width)
Overrides the method from WidgetBase, execute CmdChangeLineWidth.
Definition: umlwidget.cpp:934
virtual QSizeF calculateSize(bool withExtensions=true) const
calculate content related size of widget.
Definition: umlwidget.cpp:1227
void sigWidgetMoved(Uml::ID::Type id)
Emit when the widget moves its' position.
QRectF rect() const
return drawing rectangle of widget in local coordinates
Definition: widgetbase.cpp:611
virtual void slotFillColorChanged(Uml::ID::Type viewID)
Captures a color change signal.
Definition: umlwidget.cpp:805
Definition: umlwidget.h:223
virtual void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: umlwidget.cpp:1461
void setInstanceName(const QString &instanceName)
Write property of m_instanceName.
Definition: umlwidget.h:162
bool getIgnoreSnapToGrid() const
Return the value of m_ignoreSnapToGrid.
Definition: umlwidget.cpp:1513
Definition: widgetbase.h:43
Definition: umlwidget.h:216
virtual void setLineColor(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:924
void adjustUnselectedAssocs(qreal dx, qreal dy)
Adjusts all unselected associations with the given co-ordinates.
Definition: umlwidget.cpp:1119
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
A virtual method to save the properties of this widget into a QDomElement i.e xml.
Definition: umlwidget.cpp:1810
qreal width() const
void removeAssoc(AssociationWidget *pAssoc)
Removes an already created association from the list of associations that include this UMLWidget...
Definition: umlwidget.cpp:1076
Definition: umlwidget.h:220
QSizeF startResizeSize() const
Return the start size of the resize action.
Definition: umlwidget.cpp:631
void deselect(QGraphicsSceneMouseEvent *me)
Deselects the widget and removes it from the list of selected widgets.
Definition: umlwidget.cpp:1399
bool showStereotype() const
Returns the status of whether to show Stereotype.
Definition: umlwidget.cpp:1795
void setFillColorCmd(const QColor &color)
Sets the background fill color.
Definition: umlwidget.cpp:967
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse press event.
Definition: umlwidget.cpp:378
virtual void setFont(const QFont &font)
Sets the font the widget is to use.
Definition: umlwidget.cpp:1720
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Moves the widget to a new position using the difference between the current position and the new posi...
Definition: umlwidget.cpp:295
void addAssoc(AssociationWidget *pAssoc)
Adds an already created association to the list of associations that include this UMLWidget...
Definition: umlwidget.cpp:1065
Arrow tool for select, move and resize widgets and associations.
Definition: toolbarstatearrow.h:30
void setupFontType(QFont &font, UMLWidget::FontType fontType)
Definition: umlwidget.cpp:1589
void clipSize()
clip the size of this widget against the minimal and maximal limits.
Definition: umlwidget.cpp:1572
Definition: umlwidget.h:219
virtual void setShowStereotype(bool flag)
Set the status of whether to show Stereotype.
Definition: umlwidget.cpp:1783
virtual void setUseFillColor(bool fc)
Set the status of using fill color (undo action)
Definition: umlwidget.cpp:874
qreal height() const
virtual QSizeF maximumSize()
Compute the maximum possible width and height.
Definition: umlwidget.cpp:254
bool m_isInstance
holds whether this widget is a component instance (i.e. on a deployment diagram)
Definition: umlwidget.h:286
virtual void adjustAssocs(qreal dx, qreal dy)
Adjusts associations with the given co-ordinates.
Definition: umlwidget.cpp:1089
QString m_oldStatusBarMsg
The text in the status bar when the cursor was pressed.
Definition: umlwidget.h:313
AssociationWidgetList m_Assocs
A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram.
Definition: umlwidget.h:283
virtual void constrainMovementForAllWidgets(qreal &diffX, qreal &diffY)
Modifies the value of the diffX and diffY variables used to move the widgets.
Definition: umlwidget.cpp:318
void setFontCmd(const QFont &font)
Sets the font the widget is to use.
Definition: umlwidget.cpp:1735
bool m_moved
If the widget was selected/moved/resized in the press and release cycle.
Definition: umlwidget.h:339
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition: umlwidget.cpp:1701
void setMinimumSize(const QSizeF &size)
This method is used to set the minimum size variable for this widget.
Definition: umlwidget.cpp:244
virtual QFont font() const
Returns the font used for diaplaying any text.
Definition: widgetbase.cpp:445
bool getStartMove() const
Returns whether we triggered the update of position movement.
Definition: umlwidget.h:104
virtual void slotWidgetMoved(Uml::ID::Type id)
Captures when another widget moves if this widget is linked to it.
Definition: umlwidget.cpp:796
virtual void setDefaultFontMetrics(QFont &font, UMLWidget::FontType fontType)
Template Method, override this to set the default font metric.
Definition: umlwidget.cpp:1583
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.