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

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
WidgetBase Class Reference

Common base class for UMLWidget and AssociationWidget. More...

`#include <widgetbase.h>`

Inheritance diagram for WidgetBase:

## Public Types
enum | WidgetType { wt_Min = 299 , wt_UMLWidget , wt_Actor , wt_UseCase , wt_Class , wt_Interface , wt_Datatype , wt_Enum , wt_Entity , wt_Package , wt_Object , wt_Note , wt_Box , wt_Message , wt_Text , wt_State , wt_Activity , wt_Component , wt_Artifact , wt_Node , wt_Association , wt_ForkJoin , wt_Precondition , wt_CombinedFragment , wt_FloatingDashLine , wt_Signal , wt_Pin , wt_ObjectNode , wt_Region , wt_Category , wt_Port , wt_Instance , wt_Max }

## Public Slots
virtual void | slotMenuSelection (QAction *trigger)

## Public Member Functions
| WidgetBase (UMLScene *scene, WidgetType type=wt_UMLWidget, Uml::ID::Type id=Uml::ID::None)
virtual | ~WidgetBase ()
UMLObject * | umlObject () const
virtual void | setUMLObject (UMLObject *obj)
Uml::ID::Type | id () const
void | setID (Uml::ID::Type id)
void | setLocalID (Uml::ID::Type id)
Uml::ID::Type | localID () const
virtual UMLWidget * | widgetWithID (Uml::ID::Type id)
WidgetType | baseType () const
void | setBaseType (const WidgetType &baseType)
QLatin1String | baseTypeStr () const
QString | baseTypeStrWithoutPrefix () const
virtual void | setSelected (bool select)
UMLScene * | umlScene () const
UMLDoc * | umlDoc () const
QString | documentation () const
bool | hasDocumentation () const
virtual void | setDocumentation (const QString &doc)
QString | name () const
virtual void | setName (const QString &strName)
QColor | lineColor () const
virtual void | setLineColor (const QColor &color)
uint | lineWidth () const
virtual void | setLineWidth (uint width)
QColor | textColor () const
virtual void | setTextColor (const QColor &color)
QColor | fillColor () const
virtual void | setFillColor (const QColor &color)
bool | usesDiagramLineColor () const
void | setUsesDiagramLineColor (bool state)
bool | usesDiagramLineWidth () const
void | setUsesDiagramLineWidth (bool state)
bool | useFillColor () const
virtual void | setUseFillColor (bool state)
bool | usesDiagramTextColor () const
void | setUsesDiagramTextColor (bool state)
bool | usesDiagramFillColor () const
void | setUsesDiagramFillColor (bool state)
bool | usesDiagramUseFillColor () const
void | setUsesDiagramUseFillColor (bool state)
virtual QFont | font () const
virtual void | setFont (const QFont &font)
bool | autoResize () const
void | setAutoResize (bool state)
bool | changesShape () const
void | setChangesShape (bool state)
virtual bool | showPropertiesDialog ()
virtual bool | loadFromXMI (QDomElement &qElement)
virtual void | saveToXMI (QXmlStreamWriter &writer)
virtual void | removeAssoc (AssociationWidget *pAssoc)
virtual void | addAssoc (AssociationWidget *pAssoc)
WidgetBase & | operator= (const WidgetBase &other)
QRectF | rect () const
void | setRect (const QRectF &rect)
void | setRect (qreal x, qreal y, qreal width, qreal height)
virtual QRectF | boundingRect () const
virtual UMLWidget * | onWidget (const QPointF &p)
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
bool | isActivityWidget () const
bool | isActorWidget () const
bool | isArtifactWidget () const
bool | isAssociationWidget () const
bool | isBoxWidget () const
bool | isCategoryWidget () const
bool | isClassWidget () const
bool | isCombinedFragmentWidget () const
bool | isComponentWidget () const
bool | isDatatypeWidget () const
bool | isEntityWidget () const
bool | isEnumWidget () const
bool | isFloatingDashLineWidget () const
bool | isForkJoinWidget () const
bool | isInterfaceWidget () const
bool | isMessageWidget () const
bool | isNodeWidget () const
bool | isNoteWidget () const
bool | isObjectNodeWidget () const
bool | isObjectWidget () const
bool | isPackageWidget () const
bool | isPinWidget () const
bool | isPortWidget () const
bool | isPreconditionWidget () const
bool | isRegionWidget () const
bool | isSignalWidget () const
bool | isStateWidget () const
bool | isTextWidget () const
bool | isUseCaseWidget () const
ActivityWidget * | asActivityWidget ()
ActorWidget * | asActorWidget ()
ArtifactWidget * | asArtifactWidget ()
AssociationWidget * | asAssociationWidget ()
BoxWidget * | asBoxWidget ()
CategoryWidget * | asCategoryWidget ()
ClassifierWidget * | asClassifierWidget ()
CombinedFragmentWidget * | asCombinedFragmentWidget ()
ComponentWidget * | asComponentWidget ()
DatatypeWidget * | asDatatypeWidget ()
EntityWidget * | asEntityWidget ()
EnumWidget * | asEnumWidget ()
FloatingDashLineWidget * | asFloatingDashLineWidget ()
ForkJoinWidget * | asForkJoinWidget ()
InterfaceWidget * | asInterfaceWidget ()
MessageWidget * | asMessageWidget ()
NodeWidget * | asNodeWidget ()
NoteWidget * | asNoteWidget ()
ObjectNodeWidget * | asObjectNodeWidget ()
ObjectWidget * | asObjectWidget ()
PackageWidget * | asPackageWidget ()
PinWidget * | asPinWidget ()
PinPortBase * | asPinPortBase ()
PortWidget * | asPortWidget ()
PreconditionWidget * | asPreconditionWidget ()
RegionWidget * | asRegionWidget ()
SignalWidget * | asSignalWidget ()
StateWidget * | asStateWidget ()
FloatingTextWidget * | asFloatingTextWidget ()
UseCaseWidget * | asUseCaseWidget ()
UMLWidget * | asUMLWidget ()
const ActivityWidget * | asActivityWidget () const
const ActorWidget * | asActorWidget () const
const ArtifactWidget * | asArtifactWidget () const
const AssociationWidget * | asAssociationWidget () const
const BoxWidget * | asBoxWidget () const
const CategoryWidget * | asCategoryWidget () const
const ClassifierWidget * | asClassifierWidget () const
const CombinedFragmentWidget * | asCombinedFragmentWidget () const
const ComponentWidget * | asComponentWidget () const
const DatatypeWidget * | asDatatypeWidget () const
const EntityWidget * | asEntityWidget () const
const EnumWidget * | asEnumWidget () const
const FloatingDashLineWidget * | asFloatingDashLineWidget () const
const ForkJoinWidget * | asForkJoinWidget () const
const InterfaceWidget * | asInterfaceWidget () const
const MessageWidget * | asMessageWidget () const
const NodeWidget * | asNodeWidget () const
const NoteWidget * | asNoteWidget () const
const ObjectNodeWidget * | asObjectNodeWidget () const
const ObjectWidget * | asObjectWidget () const
const PackageWidget * | asPackageWidget () const
const PinWidget * | asPinWidget () const
const PinPortBase * | asPinPortBase () const
const PortWidget * | asPortWidget () const
const PreconditionWidget * | asPreconditionWidget () const
const RegionWidget * | asRegionWidget () const
const SignalWidget * | asSignalWidget () const
const StateWidget * | asStateWidget () const
const FloatingTextWidget * | asFloatingTextWidget () const
const UseCaseWidget * | asUseCaseWidget () const
const UMLWidget * | asUMLWidget () const
virtual bool | activate (IDChangeLog *changeLog=0)

## Static Public Member Functions
static QString | toString (WidgetType wt)
static QString | toI18nString (WidgetType wt)
static Icon_Utils::IconType | toIcon (WidgetType wt)
static bool | widgetHasUMLObject (WidgetBase::WidgetType type)

## Protected Member Functions
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
Protected Member Functions inherited from QGraphicsObjectWrapper
QVariant | itemChange (GraphicsItemChange change, const QVariant &value)

## Protected Attributes
UMLScene * | m_scene
QPointer< UMLObject > | m_umlObject
QString | m_Doc
| Only used if m_umlObject is not set.
QString | m_Text
QRectF | m_rect
| Widget size. In this rectangle, the x and y coordinates are always 0.
Uml::ID::Type | m_nId
Uml::ID::Type | m_nLocalID
QColor | m_textColor
| Color of the text of the widget. Is saved to XMI.
QColor | m_lineColor
| Color of the lines of the widget. Is saved to XMI.
QColor | m_fillColor
| color of the background of the widget
QBrush | m_brush
QFont | m_font
uint | m_lineWidth
| Width of the lines of the widget. Is saved to XMI.
bool | m_useFillColor
| flag indicates if the UMLWidget uses the Diagram FillColour
bool | m_usesDiagramFillColor
bool | m_usesDiagramLineColor
bool | m_usesDiagramLineWidth
bool | m_usesDiagramTextColor
bool | m_usesDiagramUseFillColor
bool | m_autoResize
bool | m_changesShape
| The widget changes its shape when the number of connections or their positions are changed.
Protected Attributes inherited from QGraphicsObjectWrapper
bool | m_calledFromItemChange {false}

## Private Attributes
WidgetType | m_baseType
| Type of widget.

## Detailed Description

Common base class for UMLWidget and AssociationWidget.

Author
  Oliver Kellogg okell.nosp@m.ogg@.nosp@m.users.nosp@m..sou.nosp@m.rcefo.nosp@m.rge..nosp@m.net Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

## Member Enumeration Documentation

## ◆ WidgetType

enum WidgetBase::WidgetType

Enumerator
wt_Min |
wt_UMLWidget |
wt_Actor |
wt_UseCase |
wt_Class |
wt_Interface |
wt_Datatype |
wt_Enum |
wt_Entity |
wt_Package |
wt_Object |
wt_Note |
wt_Box |
wt_Message |
wt_Text |
wt_State |
wt_Activity |
wt_Component |
wt_Artifact |
wt_Node |
wt_Association |
wt_ForkJoin |
wt_Precondition |
wt_CombinedFragment |
wt_FloatingDashLine |
wt_Signal |
wt_Pin |
wt_ObjectNode |
wt_Region |
wt_Category |
wt_Port |
wt_Instance |
wt_Max |

## Constructor & Destructor Documentation

## ◆ WidgetBase()

WidgetBase::WidgetBase | ( | UMLScene * | scene,
|  | WidgetType | type = wt_UMLWidget,
|  | Uml::ID::Type | id = Uml::ID::None )
| explicit

Creates a WidgetBase object.

Parameters

  scene | The view to be displayed on.
  type | The WidgetType to construct. This must be set to the appropriate value by the constructors of inheriting classes.
  id | The XMI ID to use. The value Uml::ID::None will trigger generation of a new ID.

## ◆ ~WidgetBase()

WidgetBase::~WidgetBase | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ activate()

bool WidgetBase::activate | ( | IDChangeLog * | changeLog = 0 | ) |
| virtual

Activate the object after deserializing it from XMI

Parameters

  changeLog | optional pointer to IDChangeLog object

Returns
  true for success

Reimplemented in AssociationWidget, CombinedFragmentWidget, FloatingTextWidget, MessageWidget, ObjectWidget, PinPortBase, PreconditionWidget, and UMLWidget.

## ◆ addAssoc()

void WidgetBase::addAssoc | ( | AssociationWidget * | pAssoc | ) |
| virtual

Adds an already created association to the list of associations that include this UMLWidget

Reimplemented in UMLWidget.

## ◆ asActivityWidget() [1/2]

ActivityWidget * WidgetBase::asActivityWidget | ( |  | ) |

## ◆ asActivityWidget() [2/2]

const ActivityWidget * WidgetBase::asActivityWidget | ( |  | ) | const

## ◆ asActorWidget() [1/2]

ActorWidget * WidgetBase::asActorWidget | ( |  | ) |

## ◆ asActorWidget() [2/2]

const ActorWidget * WidgetBase::asActorWidget | ( |  | ) | const

## ◆ asArtifactWidget() [1/2]

ArtifactWidget * WidgetBase::asArtifactWidget | ( |  | ) |

## ◆ asArtifactWidget() [2/2]

const ArtifactWidget * WidgetBase::asArtifactWidget | ( |  | ) | const

## ◆ asAssociationWidget() [1/2]

AssociationWidget * WidgetBase::asAssociationWidget | ( |  | ) |

## ◆ asAssociationWidget() [2/2]

const AssociationWidget * WidgetBase::asAssociationWidget | ( |  | ) | const

## ◆ asBoxWidget() [1/2]

BoxWidget * WidgetBase::asBoxWidget | ( |  | ) |

## ◆ asBoxWidget() [2/2]

const BoxWidget * WidgetBase::asBoxWidget | ( |  | ) | const

## ◆ asCategoryWidget() [1/2]

CategoryWidget * WidgetBase::asCategoryWidget | ( |  | ) |

## ◆ asCategoryWidget() [2/2]

const CategoryWidget * WidgetBase::asCategoryWidget | ( |  | ) | const

## ◆ asClassifierWidget() [1/2]

ClassifierWidget * WidgetBase::asClassifierWidget | ( |  | ) |

## ◆ asClassifierWidget() [2/2]

const ClassifierWidget * WidgetBase::asClassifierWidget | ( |  | ) | const

## ◆ asCombinedFragmentWidget() [1/2]

CombinedFragmentWidget * WidgetBase::asCombinedFragmentWidget | ( |  | ) |

## ◆ asCombinedFragmentWidget() [2/2]

const CombinedFragmentWidget * WidgetBase::asCombinedFragmentWidget | ( |  | ) | const

## ◆ asComponentWidget() [1/2]

ComponentWidget * WidgetBase::asComponentWidget | ( |  | ) |

## ◆ asComponentWidget() [2/2]

const ComponentWidget * WidgetBase::asComponentWidget | ( |  | ) | const

## ◆ asDatatypeWidget() [1/2]

DatatypeWidget * WidgetBase::asDatatypeWidget | ( |  | ) |

## ◆ asDatatypeWidget() [2/2]

const DatatypeWidget * WidgetBase::asDatatypeWidget | ( |  | ) | const

## ◆ asEntityWidget() [1/2]

EntityWidget * WidgetBase::asEntityWidget | ( |  | ) |

## ◆ asEntityWidget() [2/2]

const EntityWidget * WidgetBase::asEntityWidget | ( |  | ) | const

## ◆ asEnumWidget() [1/2]

EnumWidget * WidgetBase::asEnumWidget | ( |  | ) |

## ◆ asEnumWidget() [2/2]

const EnumWidget * WidgetBase::asEnumWidget | ( |  | ) | const

## ◆ asFloatingDashLineWidget() [1/2]

FloatingDashLineWidget * WidgetBase::asFloatingDashLineWidget | ( |  | ) |

## ◆ asFloatingDashLineWidget() [2/2]

const FloatingDashLineWidget * WidgetBase::asFloatingDashLineWidget | ( |  | ) | const

## ◆ asFloatingTextWidget() [1/2]

FloatingTextWidget * WidgetBase::asFloatingTextWidget | ( |  | ) |

## ◆ asFloatingTextWidget() [2/2]

const FloatingTextWidget * WidgetBase::asFloatingTextWidget | ( |  | ) | const

## ◆ asForkJoinWidget() [1/2]

ForkJoinWidget * WidgetBase::asForkJoinWidget | ( |  | ) |

## ◆ asForkJoinWidget() [2/2]

const ForkJoinWidget * WidgetBase::asForkJoinWidget | ( |  | ) | const

## ◆ asInterfaceWidget() [1/2]

InterfaceWidget * WidgetBase::asInterfaceWidget | ( |  | ) |

## ◆ asInterfaceWidget() [2/2]

const InterfaceWidget * WidgetBase::asInterfaceWidget | ( |  | ) | const

## ◆ asMessageWidget() [1/2]

MessageWidget * WidgetBase::asMessageWidget | ( |  | ) |

## ◆ asMessageWidget() [2/2]

const MessageWidget * WidgetBase::asMessageWidget | ( |  | ) | const

## ◆ asNodeWidget() [1/2]

NodeWidget * WidgetBase::asNodeWidget | ( |  | ) |

## ◆ asNodeWidget() [2/2]

const NodeWidget * WidgetBase::asNodeWidget | ( |  | ) | const

## ◆ asNoteWidget() [1/2]

NoteWidget * WidgetBase::asNoteWidget | ( |  | ) |

## ◆ asNoteWidget() [2/2]

const NoteWidget * WidgetBase::asNoteWidget | ( |  | ) | const

## ◆ asObjectNodeWidget() [1/2]

ObjectNodeWidget * WidgetBase::asObjectNodeWidget | ( |  | ) |

## ◆ asObjectNodeWidget() [2/2]

const ObjectNodeWidget * WidgetBase::asObjectNodeWidget | ( |  | ) | const

## ◆ asObjectWidget() [1/2]

ObjectWidget * WidgetBase::asObjectWidget | ( |  | ) |

## ◆ asObjectWidget() [2/2]

const ObjectWidget * WidgetBase::asObjectWidget | ( |  | ) | const

## ◆ asPackageWidget() [1/2]

PackageWidget * WidgetBase::asPackageWidget | ( |  | ) |

## ◆ asPackageWidget() [2/2]

const PackageWidget * WidgetBase::asPackageWidget | ( |  | ) | const

## ◆ asPinPortBase() [1/2]

PinPortBase * WidgetBase::asPinPortBase | ( |  | ) |

## ◆ asPinPortBase() [2/2]

const PinPortBase * WidgetBase::asPinPortBase | ( |  | ) | const

## ◆ asPinWidget() [1/2]

PinWidget * WidgetBase::asPinWidget | ( |  | ) |

## ◆ asPinWidget() [2/2]

const PinWidget * WidgetBase::asPinWidget | ( |  | ) | const

## ◆ asPortWidget() [1/2]

PortWidget * WidgetBase::asPortWidget | ( |  | ) |

## ◆ asPortWidget() [2/2]

const PortWidget * WidgetBase::asPortWidget | ( |  | ) | const

## ◆ asPreconditionWidget() [1/2]

PreconditionWidget * WidgetBase::asPreconditionWidget | ( |  | ) |

## ◆ asPreconditionWidget() [2/2]

const PreconditionWidget * WidgetBase::asPreconditionWidget | ( |  | ) | const

## ◆ asRegionWidget() [1/2]

RegionWidget * WidgetBase::asRegionWidget | ( |  | ) |

## ◆ asRegionWidget() [2/2]

const RegionWidget * WidgetBase::asRegionWidget | ( |  | ) | const

## ◆ asSignalWidget() [1/2]

SignalWidget * WidgetBase::asSignalWidget | ( |  | ) |

## ◆ asSignalWidget() [2/2]

const SignalWidget * WidgetBase::asSignalWidget | ( |  | ) | const

## ◆ asStateWidget() [1/2]

StateWidget * WidgetBase::asStateWidget | ( |  | ) |

## ◆ asStateWidget() [2/2]

const StateWidget * WidgetBase::asStateWidget | ( |  | ) | const

## ◆ asUMLWidget() [1/2]

UMLWidget * WidgetBase::asUMLWidget | ( |  | ) |

## ◆ asUMLWidget() [2/2]

const UMLWidget * WidgetBase::asUMLWidget | ( |  | ) | const

## ◆ asUseCaseWidget() [1/2]

UseCaseWidget * WidgetBase::asUseCaseWidget | ( |  | ) |

## ◆ asUseCaseWidget() [2/2]

const UseCaseWidget * WidgetBase::asUseCaseWidget | ( |  | ) | const

## ◆ autoResize()

bool WidgetBase::autoResize | ( |  | ) | const

Return state of auto resize property

Returns
  the auto resize state

## ◆ baseType()

WidgetBase::WidgetType WidgetBase::baseType | ( |  | ) | const

Read property of m_baseType.

## ◆ baseTypeStr()

QLatin1String WidgetBase::baseTypeStr | ( |  | ) | const

Returns
  The type used for rtti as string.

## ◆ baseTypeStrWithoutPrefix()

QString WidgetBase::baseTypeStrWithoutPrefix | ( |  | ) | const

Returns
  The type as string without 'wt_' prefix.

## ◆ boundingRect()

QRectF WidgetBase::boundingRect | ( |  | ) | const
| virtual

Returns
  The bounding rectangle for this widget.

See also
  setRect

Reimplemented in AssociationWidget, CombinedFragmentWidget, and PinPortBase.

## ◆ changesShape()

bool WidgetBase::changesShape | ( |  | ) | const

Return changes state property

Returns
  the changes shape state

## ◆ contextMenuEvent()

void WidgetBase::contextMenuEvent | ( | QGraphicsSceneContextMenuEvent * | event | ) |
| protected virtual

Reimplemented to show appropriate context menu.

Reimplemented in AssociationWidget, StateWidget, and UMLWidget.

## ◆ documentation()

QString WidgetBase::documentation | ( |  | ) | const

Used by some child classes to get documentation.

Returns
  The documentation from the UMLObject (if m_umlObject is set.)

## ◆ fillColor()

QColor WidgetBase::fillColor | ( |  | ) | const

Returns fill color

Returns
  currently used fill color

## ◆ font()

QFont WidgetBase::font | ( |  | ) | const
| virtual

Returns the font used for displaying any text.

Returns
  the font

Reimplemented in AssociationWidget.

## ◆ hasDocumentation()

bool WidgetBase::hasDocumentation | ( |  | ) | const

Returns state of documentation for the widget.

Returns
  false if documentation is empty

## ◆ id()

Uml::ID::Type WidgetBase::id | ( |  | ) | const

Read property of m_nId.

## ◆ isActivityWidget()

bool WidgetBase::isActivityWidget | ( |  | ) | const
| inline

## ◆ isActorWidget()

bool WidgetBase::isActorWidget | ( |  | ) | const
| inline

## ◆ isArtifactWidget()

bool WidgetBase::isArtifactWidget | ( |  | ) | const
| inline

## ◆ isAssociationWidget()

bool WidgetBase::isAssociationWidget | ( |  | ) | const
| inline

## ◆ isBoxWidget()

bool WidgetBase::isBoxWidget | ( |  | ) | const
| inline

## ◆ isCategoryWidget()

bool WidgetBase::isCategoryWidget | ( |  | ) | const
| inline

## ◆ isClassWidget()

bool WidgetBase::isClassWidget | ( |  | ) | const
| inline

## ◆ isCombinedFragmentWidget()

bool WidgetBase::isCombinedFragmentWidget | ( |  | ) | const
| inline

## ◆ isComponentWidget()

bool WidgetBase::isComponentWidget | ( |  | ) | const
| inline

## ◆ isDatatypeWidget()

bool WidgetBase::isDatatypeWidget | ( |  | ) | const
| inline

## ◆ isEntityWidget()

bool WidgetBase::isEntityWidget | ( |  | ) | const
| inline

## ◆ isEnumWidget()

bool WidgetBase::isEnumWidget | ( |  | ) | const
| inline

## ◆ isFloatingDashLineWidget()

bool WidgetBase::isFloatingDashLineWidget | ( |  | ) | const
| inline

## ◆ isForkJoinWidget()

bool WidgetBase::isForkJoinWidget | ( |  | ) | const
| inline

## ◆ isInterfaceWidget()

bool WidgetBase::isInterfaceWidget | ( |  | ) | const
| inline

## ◆ isMessageWidget()

bool WidgetBase::isMessageWidget | ( |  | ) | const
| inline

## ◆ isNodeWidget()

bool WidgetBase::isNodeWidget | ( |  | ) | const
| inline

## ◆ isNoteWidget()

bool WidgetBase::isNoteWidget | ( |  | ) | const
| inline

## ◆ isObjectNodeWidget()

bool WidgetBase::isObjectNodeWidget | ( |  | ) | const
| inline

## ◆ isObjectWidget()

bool WidgetBase::isObjectWidget | ( |  | ) | const
| inline

## ◆ isPackageWidget()

bool WidgetBase::isPackageWidget | ( |  | ) | const
| inline

## ◆ isPinWidget()

bool WidgetBase::isPinWidget | ( |  | ) | const
| inline

## ◆ isPortWidget()

bool WidgetBase::isPortWidget | ( |  | ) | const
| inline

## ◆ isPreconditionWidget()

bool WidgetBase::isPreconditionWidget | ( |  | ) | const
| inline

## ◆ isRegionWidget()

bool WidgetBase::isRegionWidget | ( |  | ) | const
| inline

## ◆ isSignalWidget()

bool WidgetBase::isSignalWidget | ( |  | ) | const
| inline

## ◆ isStateWidget()

bool WidgetBase::isStateWidget | ( |  | ) | const
| inline

## ◆ isTextWidget()

bool WidgetBase::isTextWidget | ( |  | ) | const
| inline

## ◆ isUseCaseWidget()

bool WidgetBase::isUseCaseWidget | ( |  | ) | const
| inline

## ◆ lineColor()

QColor WidgetBase::lineColor | ( |  | ) | const

Returns line color

Returns
  currently used line color

## ◆ lineWidth()

uint WidgetBase::lineWidth | ( |  | ) | const

Returns line width

Returns
  currently used line with

## ◆ loadFromXMI()

bool WidgetBase::loadFromXMI | ( | QDomElement & | qElement | ) |
| virtual

A virtual method to load the properties of this widget from a QDomElement into this widget.

Subclasses should reimplement this to load additional properties required, calling this base method to load the basic properties of the widget.

Parameters

  qElement | A QDomElement which contains xml info for this widget.

Todo
  Add support to load older version.

Reimplemented in ActivityWidget, AssociationWidget, ClassifierWidget, CombinedFragmentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, and UMLWidget.

## ◆ localID()

Uml::ID::Type WidgetBase::localID | ( |  | ) | const

Returns the local ID for this object. This ID is used so that many objects of the same UMLObject instance can be on the same diagram.

Returns
  The local ID.

## ◆ name()

QString WidgetBase::name | ( |  | ) | const

Gets the name from the corresponding UMLObject if this widget has an underlying UMLObject; if it does not then it returns the local m_Text (notably the case for FloatingTextWidget.)

Returns
  the currently set name

## ◆ onWidget()

UMLWidget * WidgetBase::onWidget | ( | const QPointF & | p | ) |
| virtual

Test if point is inside the bounding rectangle of the widget. Inheriting classes may reimplement this to test possible child widgets.

Parameters

  p | Point to be checked.

Returns
  'this' if the given point is in the boundaries of the widget; else NULL.

Reimplemented in AssociationWidget, ClassifierWidget, FloatingTextWidget, MessageWidget, and PinPortBase.

## ◆ operator=()

WidgetBase & WidgetBase::operator= | ( | const WidgetBase & | other | ) |

Assignment operator

## ◆ paint()

void WidgetBase::paint | ( | QPainter * | painter,
|  | const QStyleOptionGraphicsItem * | option,
|  | QWidget * | widget = 0 )
| virtual

Draws the UMLWidget on the given paint device

Parameters

  painter | The painter for the drawing device
  option | Painting related options
  widget | Background widget on which to paint (optional)

Reimplemented in ActivityWidget, ActorWidget, ArtifactWidget, BoxWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, ComponentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NodeWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PackageWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, UMLWidget, and UseCaseWidget.

## ◆ rect()

QRectF WidgetBase::rect | ( |  | ) | const

return drawing rectangle of widget in local coordinates

## ◆ removeAssoc()

void WidgetBase::removeAssoc | ( | AssociationWidget * | pAssoc | ) |
| virtual

Removes an already created association from the list of associations that include this UMLWidget

Reimplemented in UMLWidget.

## ◆ saveToXMI()

void WidgetBase::saveToXMI | ( | QXmlStreamWriter & | writer | ) |
| virtual

A virtual method to save the properties of this widget into a QXmlStreamWriter i.e. XML.

Subclasses should first create a new dedicated element as the child of qElement parameter passed. Then this base method should be called to save basic widget properties.

Parameters

  writer | The QXmlStreamWriter to write to.

Reimplemented in ActivityWidget, ActorWidget, ArtifactWidget, AssociationWidget, BoxWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, ComponentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NodeWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PackageWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, UMLWidget, and UseCaseWidget.

## ◆ setAutoResize()

void WidgetBase::setAutoResize | ( | bool | state | ) |

set auto resize state

Parameters

  state |

## ◆ setBaseType()

void WidgetBase::setBaseType | ( | const WidgetType & | baseType | ) |

Set property m_baseType. Used for types changing their types during runtime.

## ◆ setChangesShape()

void WidgetBase::setChangesShape | ( | bool | state | ) |

set changes shape property

Parameters

  state |

## ◆ setDocumentation()

void WidgetBase::setDocumentation | ( | const QString & | doc | ) |
| virtual

Used by some child classes to set documentation.

Parameters

  doc | The documentation to be set in the UMLObject (if m_umlObject is set.)

Reimplemented in ClassifierWidget.

## ◆ setFillColor()

void WidgetBase::setFillColor | ( | const QColor & | color | ) |
| virtual

Sets the fill color

Parameters

  color | The new fill color

Reimplemented in UMLWidget.

## ◆ setFont()

void WidgetBase::setFont | ( | const QFont & | font | ) |
| virtual

Set the font used to display text inside this widget.

Reimplemented in UMLWidget.

## ◆ setID()

void WidgetBase::setID | ( | Uml::ID::Type | id | ) |

Write property of m_nId.

## ◆ setLineColor()

void WidgetBase::setLineColor | ( | const QColor & | color | ) |
| virtual

Sets the line color

Parameters

  color | The new line color

Reimplemented in AssociationWidget, and UMLWidget.

## ◆ setLineWidth()

void WidgetBase::setLineWidth | ( | uint | width | ) |
| virtual

Sets the line width

Parameters

  width | The new line width

Reimplemented in AssociationWidget, and UMLWidget.

## ◆ setLocalID()

void WidgetBase::setLocalID | ( | Uml::ID::Type | id | ) |

Sets the local id of the object.

Parameters

  id | The local id of the object.

## ◆ setName()

void WidgetBase::setName | ( | const QString & | strName | ) |
| virtual

Sets the name in the corresponding UMLObject. Sets the local m_Text if m_umlObject is NULL.

Parameters

  strName | The name to be set.

Reimplemented in AssociationWidget, PinPortBase, and SignalWidget.

## ◆ setRect() [1/2]

void WidgetBase::setRect | ( | const QRectF & | rect | ) |

set widget rectangle in item coordinates

## ◆ setRect() [2/2]

void WidgetBase::setRect | ( | qreal | x,
|  | qreal | y,
|  | qreal | width,
|  | qreal | height )

set widget rectangle in item coordinates

## ◆ setSelected()

void WidgetBase::setSelected | ( | bool | select | ) |
| virtual

Reimplemented from QGraphicsObjectWrapper.

Reimplemented in AssociationWidget, MessageWidget, ObjectWidget, and UMLWidget.

## ◆ setTextColor()

void WidgetBase::setTextColor | ( | const QColor & | color | ) |
| virtual

Sets the text color

Parameters

  color | the new text color

Reimplemented in AssociationWidget, and UMLWidget.

## ◆ setUMLObject()

void WidgetBase::setUMLObject | ( | UMLObject * | obj | ) |
| virtual

Sets the UMLObject to represent.

Parameters

  obj | The object to represent.

Reimplemented in AssociationWidget, and ClassifierWidget.

## ◆ setUseFillColor()

void WidgetBase::setUseFillColor | ( | bool | state | ) |
| virtual

Set state if fill color is used

Parameters

  state | The state to set

Reimplemented in UMLWidget.

## ◆ setUsesDiagramFillColor()

void WidgetBase::setUsesDiagramFillColor | ( | bool | state | ) |

Set state if diagram fill color is used

Parameters

  state | The state to set

## ◆ setUsesDiagramLineColor()

void WidgetBase::setUsesDiagramLineColor | ( | bool | state | ) |

Set state of diagram line color is used

Parameters

  state | The state to set

## ◆ setUsesDiagramLineWidth()

void WidgetBase::setUsesDiagramLineWidth | ( | bool | state | ) |

Set state of diagram line width is used

Parameters

  state | The state to set

## ◆ setUsesDiagramTextColor()

void WidgetBase::setUsesDiagramTextColor | ( | bool | state | ) |

Set state if diagram text color is used

Parameters

  state | The state to set

## ◆ setUsesDiagramUseFillColor()

void WidgetBase::setUsesDiagramUseFillColor | ( | bool | state | ) |

Set state of diagram use fill color is used

Parameters

  state | The state to set

## ◆ showPropertiesDialog()

bool WidgetBase::showPropertiesDialog | ( |  | ) |
| virtual

A virtual method for the widget to display a property dialog box. Subclasses should reimplement this appropriately. In case the user cancels the dialog or there are some requirements not fulfilled the method returns false; true otherwise.

Returns
  true - properties has been applyed
  false - properties has not been applied

Reimplemented in ActivityWidget, AssociationWidget, BoxWidget, ClassifierWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, SignalWidget, StateWidget, and UMLWidget.

## ◆ slotMenuSelection

void WidgetBase::slotMenuSelection | ( | QAction * | trigger | ) |
| virtual slot

This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMenu which can be used to get the type of action of trigger.

Note
  Subclasses can reimplement to handle specific actions and leave the rest to WidgetBase::slotMenuSelection.

Reimplemented in FloatingDashLineWidget.

## ◆ textColor()

QColor WidgetBase::textColor | ( |  | ) | const

Returns text color

Returns
  currently used text color

## ◆ toI18nString()

QString WidgetBase::toI18nString | ( | WidgetType | wt | ) |
| static

Returns the given enum value as localized string.

Parameters

  wt | WidgetType of which a string representation is wanted

Returns
  the WidgetType as localized string

## ◆ toIcon()

Icon_Utils::IconType WidgetBase::toIcon | ( | WidgetBase::WidgetType | wt | ) |
| static

Returns the given enum value as icon type.

Parameters

  wt | WidgetType of which an icon type representation is wanted

Returns
  the WidgetType as icon type

## ◆ toString()

QString WidgetBase::toString | ( | WidgetType | wt | ) |
| static

Helper function for debug output. Returns the given enum value as string.

Parameters

  wt | WidgetType of which a string representation is wanted

Returns
  the WidgetType as string

## ◆ umlDoc()

UMLDoc * WidgetBase::umlDoc | ( |  | ) | const

This is shortcut method for UMLApp::app()->document().

Returns
  Pointer to the UMLDoc object.

## ◆ umlObject()

UMLObject * WidgetBase::umlObject | ( |  | ) | const

Returns the UMLObject set to represent.

Returns
  the UMLObject to represent.

## ◆ umlScene()

UMLScene * WidgetBase::umlScene | ( |  | ) | const

Deliver a pointer to the connected UMLView (needed esp. by event handling of AssociationLine).

## ◆ useFillColor()

bool WidgetBase::useFillColor | ( |  | ) | const

Return state of fill color usage

Returns
  True if fill color is used

## ◆ usesDiagramFillColor()

bool WidgetBase::usesDiagramFillColor | ( |  | ) | const

Returns state of diagram fill color is used

Returns
  True means diagrams fill color is used

## ◆ usesDiagramLineColor()

bool WidgetBase::usesDiagramLineColor | ( |  | ) | const

Returns state of diagram line color is used

Returns
  True means diagrams line color is used

## ◆ usesDiagramLineWidth()

bool WidgetBase::usesDiagramLineWidth | ( |  | ) | const

Returns state of diagram line width is used

Returns
  True means diagrams line width is used

## ◆ usesDiagramTextColor()

bool WidgetBase::usesDiagramTextColor | ( |  | ) | const

Returns state if diagram text color is used

Returns
  True means diagram text color is used

## ◆ usesDiagramUseFillColor()

bool WidgetBase::usesDiagramUseFillColor | ( |  | ) | const

Returns state of diagram use fill color is used

Returns
  True means diagrams fill color is used

## ◆ widgetHasUMLObject()

bool WidgetBase::widgetHasUMLObject | ( | WidgetBase::WidgetType | type | ) |
| static

Returns whether the widget type has an associated UMLObject

## ◆ widgetWithID()

UMLWidget * WidgetBase::widgetWithID | ( | Uml::ID::Type | id | ) |
| virtual

Returns the widget with the given ID. The default implementation tests the following IDs:

- m_nLocalID
- if m_umlObject is non NULL: m_umlObject->id()
- m_nID Composite widgets override this function to test further owned widgets.

Parameters

  id | The ID to test this widget against.

Returns
  'this' if id is either of m_nLocalID, m_umlObject->id(), or m_nId; else NULL.

Reimplemented in ClassifierWidget, and PinPortBase.

## Member Data Documentation

## ◆ m_autoResize

bool WidgetBase::m_autoResize
| protected

## ◆ m_baseType

WidgetType WidgetBase::m_baseType
| private

Type of widget.

## ◆ m_brush

QBrush WidgetBase::m_brush
| protected

## ◆ m_changesShape

bool WidgetBase::m_changesShape
| protected

The widget changes its shape when the number of connections or their positions are changed.

## ◆ m_Doc

QString WidgetBase::m_Doc
| protected

Only used if m_umlObject is not set.

## ◆ m_fillColor

QColor WidgetBase::m_fillColor
| protected

color of the background of the widget

## ◆ m_font

QFont WidgetBase::m_font
| protected

## ◆ m_lineColor

QColor WidgetBase::m_lineColor
| protected

Color of the lines of the widget. Is saved to XMI.

## ◆ m_lineWidth

uint WidgetBase::m_lineWidth
| protected

Width of the lines of the widget. Is saved to XMI.

## ◆ m_nId

Uml::ID::Type WidgetBase::m_nId
| protected

This ID is only used when the widget does not have a corresponding UMLObject (i.e. the m_umlObject pointer is NULL.) For UMLObjects, the ID from the UMLObject is used.

## ◆ m_nLocalID

Uml::ID::Type WidgetBase::m_nLocalID
| protected

This ID is only used when a widget could be added more than once to a diagram

## ◆ m_rect

QRectF WidgetBase::m_rect
| protected

Widget size. In this rectangle, the x and y coordinates are always 0.

## ◆ m_scene

UMLScene* WidgetBase::m_scene
| protected

## ◆ m_Text

QString WidgetBase::m_Text
| protected

## ◆ m_textColor

QColor WidgetBase::m_textColor
| protected

Color of the text of the widget. Is saved to XMI.

## ◆ m_umlObject

QPointer<UMLObject> WidgetBase::m_umlObject
| protected

## ◆ m_useFillColor

bool WidgetBase::m_useFillColor
| protected

flag indicates if the UMLWidget uses the Diagram FillColour

## ◆ m_usesDiagramFillColor

bool WidgetBase::m_usesDiagramFillColor
| protected

true by default, false if the colors have been explicitly set for this widget. These are saved to XMI.

## ◆ m_usesDiagramLineColor

bool WidgetBase::m_usesDiagramLineColor
| protected

## ◆ m_usesDiagramLineWidth

bool WidgetBase::m_usesDiagramLineWidth
| protected

## ◆ m_usesDiagramTextColor

bool WidgetBase::m_usesDiagramTextColor
| protected

## ◆ m_usesDiagramUseFillColor

bool WidgetBase::m_usesDiagramUseFillColor
| protected

The documentation for this class was generated from the following files:

- umbrello/umlwidgets/widgetbase.h
- umbrello/umlwidgets/widgetbase.cpp