umbrello/umbrello
#include <widgetbase.h>
Public Types | |
enum | WidgetType { wt_UMLWidget = 300, 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 } |
Public Slots | |
virtual void | slotMenuSelection (QAction *trigger) |
Public Member Functions | |
WidgetBase (UMLScene *scene, WidgetType type=wt_UMLWidget) | |
virtual | ~WidgetBase () |
WidgetType | baseType () const |
QLatin1String | baseTypeStr () const |
virtual QRectF | boundingRect () const |
QString | documentation () const |
QColor | fillColor () const |
virtual QFont | font () const |
bool | hasDocumentation () |
Uml::ID::Type | id () const |
QColor | lineColor () const |
uint | lineWidth () const |
virtual bool | loadFromXMI (QDomElement &qElement) |
QString | name () const |
virtual UMLWidget * | onWidget (const QPointF &p) |
WidgetBase & | operator= (const WidgetBase &other) |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
QRectF | rect () const |
virtual void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
void | setDocumentation (const QString &doc) |
virtual void | setFillColor (const QColor &color) |
virtual void | setFont (const QFont &font) |
void | setID (Uml::ID::Type id) |
virtual void | setLineColor (const QColor &color) |
virtual void | setLineWidth (uint width) |
virtual void | setName (const QString &strName) |
void | setRect (const QRectF &rect) |
void | setRect (qreal x, qreal y, qreal width, qreal height) |
virtual void | setSelected (bool select) |
virtual void | setTextColor (const QColor &color) |
virtual void | setUMLObject (UMLObject *obj) |
virtual void | setUseFillColor (bool state) |
void | setUsesDiagramFillColor (bool state) |
void | setUsesDiagramLineColor (bool state) |
void | setUsesDiagramLineWidth (bool state) |
void | setUsesDiagramTextColor (bool state) |
void | setUsesDiagramUseFillColor (bool state) |
virtual void | showPropertiesDialog () |
QColor | textColor () const |
UMLDoc * | umlDoc () const |
UMLObject * | umlObject () const |
UMLScene * | umlScene () const |
bool | useFillColor () |
bool | usesDiagramFillColor () const |
bool | usesDiagramLineColor () const |
bool | usesDiagramLineWidth () const |
bool | usesDiagramTextColor () const |
bool | usesDiagramUseFillColor () const |
Public Member Functions inherited from QGraphicsObject | |
QGraphicsObject (QGraphicsItem *parent) | |
void | enabledChanged () |
void | grabGesture (Qt::GestureType gesture, QFlags< Qt::GestureFlag > flags) |
void | opacityChanged () |
void | parentChanged () |
void | rotationChanged () |
void | scaleChanged () |
void | ungrabGesture (Qt::GestureType gesture) |
void | visibleChanged () |
void | xChanged () |
void | yChanged () |
void | zChanged () |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Public Member Functions inherited from QGraphicsItem | |
QGraphicsItem (QGraphicsItem *parent) | |
virtual | ~QGraphicsItem () |
bool | acceptDrops () const |
Qt::MouseButtons | acceptedMouseButtons () const |
bool | acceptHoverEvents () const |
bool | acceptsHoverEvents () const |
bool | acceptTouchEvents () const |
virtual void | advance (int phase) |
virtual QRectF | boundingRect () const =0 |
QRegion | boundingRegion (const QTransform &itemToDeviceTransform) const |
qreal | boundingRegionGranularity () const |
CacheMode | cacheMode () const |
QList< QGraphicsItem * > | childItems () const |
QList< QGraphicsItem * > | children () const |
QRectF | childrenBoundingRect () const |
void | clearFocus () |
QPainterPath | clipPath () const |
virtual bool | collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode) const |
virtual bool | collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode) const |
QList< QGraphicsItem * > | collidingItems (Qt::ItemSelectionMode mode) const |
QGraphicsItem * | commonAncestorItem (const QGraphicsItem *other) const |
virtual bool | contains (const QPointF &point) const |
QCursor | cursor () const |
QVariant | data (int key) const |
QTransform | deviceTransform (const QTransform &viewportTransform) const |
qreal | effectiveOpacity () const |
void | ensureVisible (const QRectF &rect, int xmargin, int ymargin) |
void | ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin, int ymargin) |
bool | filtersChildEvents () const |
GraphicsItemFlags | flags () const |
QGraphicsItem * | focusItem () const |
QGraphicsItem * | focusProxy () const |
void | grabKeyboard () |
void | grabMouse () |
QGraphicsEffect * | graphicsEffect () const |
QGraphicsItemGroup * | group () const |
bool | handlesChildEvents () const |
bool | hasCursor () const |
bool | hasFocus () const |
void | hide () |
Qt::InputMethodHints | inputMethodHints () const |
void | installSceneEventFilter (QGraphicsItem *filterItem) |
bool | isActive () const |
bool | isAncestorOf (const QGraphicsItem *child) const |
bool | isBlockedByModalPanel (QGraphicsItem **blockingPanel) const |
bool | isClipped () const |
bool | isEnabled () const |
bool | isObscured () const |
bool | isObscured (const QRectF &rect) const |
bool | isObscured (qreal x, qreal y, qreal w, qreal h) const |
virtual bool | isObscuredBy (const QGraphicsItem *item) const |
bool | isPanel () const |
bool | isSelected () const |
bool | isUnderMouse () const |
bool | isVisible () const |
bool | isVisibleTo (const QGraphicsItem *parent) const |
bool | isWidget () const |
bool | isWindow () const |
QTransform | itemTransform (const QGraphicsItem *other, bool *ok) const |
QPointF | mapFromItem (const QGraphicsItem *item, const QPointF &point) const |
QPolygonF | mapFromItem (const QGraphicsItem *item, const QRectF &rect) const |
QPolygonF | mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const |
QPainterPath | mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const |
QPointF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const |
QPolygonF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QPointF | mapFromParent (const QPointF &point) const |
QPolygonF | mapFromParent (const QRectF &rect) const |
QPolygonF | mapFromParent (const QPolygonF &polygon) const |
QPainterPath | mapFromParent (const QPainterPath &path) const |
QPointF | mapFromParent (qreal x, qreal y) const |
QPolygonF | mapFromParent (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapFromScene (const QPolygonF &polygon) const |
QPointF | mapFromScene (const QPointF &point) const |
QPolygonF | mapFromScene (const QRectF &rect) const |
QPainterPath | mapFromScene (const QPainterPath &path) const |
QPointF | mapFromScene (qreal x, qreal y) const |
QPolygonF | mapFromScene (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const |
QRectF | mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromParent (const QRectF &rect) const |
QRectF | mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromScene (const QRectF &rect) const |
QRectF | mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const |
QRectF | mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectToParent (const QRectF &rect) const |
QRectF | mapRectToParent (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectToScene (const QRectF &rect) const |
QRectF | mapRectToScene (qreal x, qreal y, qreal w, qreal h) const |
QPointF | mapToItem (const QGraphicsItem *item, const QPointF &point) const |
QPolygonF | mapToItem (const QGraphicsItem *item, const QRectF &rect) const |
QPolygonF | mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const |
QPainterPath | mapToItem (const QGraphicsItem *item, const QPainterPath &path) const |
QPointF | mapToItem (const QGraphicsItem *item, qreal x, qreal y) const |
QPolygonF | mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QPointF | mapToParent (const QPointF &point) const |
QPolygonF | mapToParent (const QRectF &rect) const |
QPainterPath | mapToParent (const QPainterPath &path) const |
QPointF | mapToParent (qreal x, qreal y) const |
QPolygonF | mapToParent (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapToParent (const QPolygonF &polygon) const |
QPolygonF | mapToScene (const QRectF &rect) const |
QPainterPath | mapToScene (const QPainterPath &path) const |
QPointF | mapToScene (qreal x, qreal y) const |
QPolygonF | mapToScene (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapToScene (const QPolygonF &polygon) const |
QPointF | mapToScene (const QPointF &point) const |
QMatrix | matrix () const |
void | moveBy (qreal dx, qreal dy) |
qreal | opacity () const |
virtual QPainterPath | opaqueArea () const |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0 |
QGraphicsItem * | panel () const |
PanelModality | panelModality () const |
QGraphicsItem * | parentItem () const |
QGraphicsObject * | parentObject () const |
QGraphicsWidget * | parentWidget () const |
QPointF | pos () const |
void | removeSceneEventFilter (QGraphicsItem *filterItem) |
void | resetMatrix () |
void | resetTransform () |
void | rotate (qreal angle) |
qreal | rotation () const |
void | scale (qreal sx, qreal sy) |
qreal | scale () const |
QGraphicsScene * | scene () const |
QRectF | sceneBoundingRect () const |
QMatrix | sceneMatrix () const |
QPointF | scenePos () const |
QTransform | sceneTransform () const |
void | scroll (qreal dx, qreal dy, const QRectF &rect) |
void | setAcceptDrops (bool on) |
void | setAcceptedMouseButtons (QFlags< Qt::MouseButton > buttons) |
void | setAcceptHoverEvents (bool enabled) |
void | setAcceptsHoverEvents (bool enabled) |
void | setAcceptTouchEvents (bool enabled) |
void | setActive (bool active) |
void | setBoundingRegionGranularity (qreal granularity) |
void | setCacheMode (CacheMode mode, const QSize &logicalCacheSize) |
void | setCursor (const QCursor &cursor) |
void | setData (int key, const QVariant &value) |
void | setEnabled (bool enabled) |
void | setFiltersChildEvents (bool enabled) |
void | setFlag (GraphicsItemFlag flag, bool enabled) |
void | setFlags (QFlags< QGraphicsItem::GraphicsItemFlag > flags) |
void | setFocus (Qt::FocusReason focusReason) |
void | setFocusProxy (QGraphicsItem *item) |
void | setGraphicsEffect (QGraphicsEffect *effect) |
void | setGroup (QGraphicsItemGroup *group) |
void | setHandlesChildEvents (bool enabled) |
void | setInputMethodHints (QFlags< Qt::InputMethodHint > hints) |
void | setMatrix (const QMatrix &matrix, bool combine) |
void | setOpacity (qreal opacity) |
void | setPanelModality (PanelModality panelModality) |
void | setParentItem (QGraphicsItem *newParent) |
void | setPos (const QPointF &pos) |
void | setPos (qreal x, qreal y) |
void | setRotation (qreal angle) |
void | setScale (qreal factor) |
void | setSelected (bool selected) |
void | setToolTip (const QString &toolTip) |
void | setTransform (const QTransform &matrix, bool combine) |
void | setTransformations (const QList< QGraphicsTransform * > &transformations) |
void | setTransformOriginPoint (qreal x, qreal y) |
void | setTransformOriginPoint (const QPointF &origin) |
void | setVisible (bool visible) |
void | setX (qreal x) |
void | setY (qreal y) |
void | setZValue (qreal z) |
virtual QPainterPath | shape () const |
void | shear (qreal sh, qreal sv) |
void | show () |
void | stackBefore (const QGraphicsItem *sibling) |
QGraphicsObject * | toGraphicsObject () |
const QGraphicsObject * | toGraphicsObject () const |
QString | toolTip () const |
QGraphicsItem * | topLevelItem () const |
QGraphicsWidget * | topLevelWidget () const |
QTransform | transform () const |
QList< QGraphicsTransform * > | transformations () const |
QPointF | transformOriginPoint () const |
void | translate (qreal dx, qreal dy) |
virtual int | type () const |
void | ungrabKeyboard () |
void | ungrabMouse () |
void | unsetCursor () |
void | update (qreal x, qreal y, qreal width, qreal height) |
void | update (const QRectF &rect) |
QGraphicsWidget * | window () const |
qreal | x () const |
qreal | y () const |
qreal | zValue () const |
Static Public Member Functions | |
static QString | toString (WidgetType wt) |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
Protected Member Functions inherited from QGraphicsObject | |
void | updateMicroFocus () |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Member Functions inherited from QGraphicsItem | |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragLeaveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | focusInEvent (QFocusEvent *event) |
virtual void | focusOutEvent (QFocusEvent *event) |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
virtual void | hoverMoveEvent (QGraphicsSceneHoverEvent *event) |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
virtual QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
void | prepareGeometryChange () |
virtual bool | sceneEvent (QEvent *event) |
virtual bool | sceneEventFilter (QGraphicsItem *watched, QEvent *event) |
void | updateMicroFocus () |
virtual void | wheelEvent (QGraphicsSceneWheelEvent *event) |
Protected Attributes | |
WidgetType | m_baseType |
QBrush | m_brush |
QString | m_Doc |
QColor | m_fillColor |
QFont | m_font |
QColor | m_lineColor |
uint | m_lineWidth |
Uml::ID::Type | m_nId |
QRectF | m_rect |
UMLScene * | m_scene |
QString | m_Text |
QColor | m_textColor |
UMLObject * | m_umlObject |
bool | m_useFillColor |
bool | m_usesDiagramFillColor |
bool | m_usesDiagramLineColor |
bool | m_usesDiagramLineWidth |
bool | m_usesDiagramTextColor |
bool | m_usesDiagramUseFillColor |
Additional Inherited Members | |
Public Attributes inherited from QGraphicsItem | |
typedef | GraphicsItemFlags |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QGraphicsObject | |
effect | |
enabled | |
opacity | |
parent | |
pos | |
rotation | |
scale | |
transformOriginPoint | |
visible | |
x | |
y | |
z | |
Properties inherited from QObject | |
objectName | |
Detailed Description
Common base class for UMLWidget and AssociationWidget.
Definition at line 35 of file widgetbase.h.
Member Enumeration Documentation
Definition at line 41 of file widgetbase.h.
Constructor & Destructor Documentation
|
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.
Definition at line 35 of file widgetbase.cpp.
|
virtual |
Destructor.
Definition at line 73 of file widgetbase.cpp.
Member Function Documentation
WidgetBase::WidgetType WidgetBase::baseType | ( | ) | const |
Read property of m_baseType.
Definition at line 80 of file widgetbase.cpp.
QLatin1String WidgetBase::baseTypeStr | ( | ) | const |
- Returns
- The type used for rtti as string.
Definition at line 88 of file widgetbase.cpp.
|
virtual |
- Returns
- The bounding rectangle for this widget.
- See also
- setRect
Reimplemented in AssociationWidget.
Definition at line 640 of file widgetbase.cpp.
|
protectedvirtual |
Reimplemented to show appropriate context menu.
Reimplemented from QGraphicsItem.
Reimplemented in UMLWidget, and AssociationWidget.
Definition at line 694 of file widgetbase.cpp.
QString WidgetBase::documentation | ( | ) | const |
Used by some child classes to get documentation.
- Returns
- The documentation from the UMLObject (if m_umlObject is set.)
Definition at line 171 of file widgetbase.cpp.
QColor WidgetBase::fillColor | ( | ) | const |
|
virtual |
Returns the font used for diaplaying any text.
- Returns
- the font
Reimplemented in AssociationWidget.
Definition at line 445 of file widgetbase.cpp.
bool WidgetBase::hasDocumentation | ( | ) |
Returns state of documentation for the widget.
- Returns
- false if documentation is empty
Definition at line 183 of file widgetbase.cpp.
Uml::ID::Type WidgetBase::id | ( | ) | const |
Read property of m_nId.
Definition at line 159 of file widgetbase.cpp.
QColor WidgetBase::lineColor | ( | ) | const |
uint WidgetBase::lineWidth | ( | ) | const |
|
virtual |
A virtual method to load the properties of this widget from a QDomElement into this widget.
Subclasses should reimplement this to load addtional 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 UMLWidget, AssociationWidget, MessageWidget, ClassifierWidget, FloatingTextWidget, StateWidget, ObjectWidget, CombinedFragmentWidget, ActivityWidget, NoteWidget, ObjectNodeWidget, SignalWidget, FloatingDashLineWidget, PinPortBase, PreconditionWidget, EnumWidget, DatatypeWidget, ForkJoinWidget, and RegionWidget.
Definition at line 517 of file widgetbase.cpp.
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
Definition at line 211 of file widgetbase.cpp.
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, MessageWidget, ClassifierWidget, FloatingTextWidget, and PinPortBase.
Definition at line 655 of file widgetbase.cpp.
WidgetBase & WidgetBase::operator= | ( | const WidgetBase & | other | ) |
Assignment operator.
Definition at line 584 of file widgetbase.cpp.
|
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 UMLWidget, MessageWidget, ClassifierWidget, FloatingTextWidget, ActivityWidget, StateWidget, CombinedFragmentWidget, NoteWidget, UseCaseWidget, ActorWidget, ObjectWidget, ObjectNodeWidget, CategoryWidget, SignalWidget, FloatingDashLineWidget, PreconditionWidget, EnumWidget, ArtifactWidget, ComponentWidget, DatatypeWidget, EntityWidget, ForkJoinWidget, PackageWidget, NodeWidget, BoxWidget, PinPortBase, and RegionWidget.
Definition at line 686 of file widgetbase.cpp.
QRectF WidgetBase::rect | ( | ) | const |
return drawing rectangle of widget in local coordinates
Definition at line 611 of file widgetbase.cpp.
|
virtual |
A virtual method to save the properties of this widget into a QDomElement 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
-
qDoc A QDomDocument object representing the xml document. qElement A QDomElement representing xml element data.
Reimplemented in UMLWidget, AssociationWidget, MessageWidget, ClassifierWidget, FloatingTextWidget, StateWidget, ObjectWidget, ActivityWidget, CombinedFragmentWidget, NoteWidget, ObjectNodeWidget, SignalWidget, FloatingDashLineWidget, UseCaseWidget, ActorWidget, PinPortBase, PreconditionWidget, CategoryWidget, EnumWidget, ComponentWidget, ArtifactWidget, DatatypeWidget, EntityWidget, ForkJoinWidget, PackageWidget, NodeWidget, BoxWidget, and RegionWidget.
Definition at line 477 of file widgetbase.cpp.
void WidgetBase::setDocumentation | ( | const QString & | doc | ) |
Used by some child classes to set documentation.
- Parameters
-
doc The documentation to be set in the UMLObject (if m_umlObject is set.)
Definition at line 196 of file widgetbase.cpp.
|
virtual |
Sets the fill color.
- Parameters
-
color The new fill color
Reimplemented in UMLWidget.
Definition at line 289 of file widgetbase.cpp.
|
virtual |
Set the font used to display text inside this widget.
Reimplemented in UMLWidget.
Definition at line 453 of file widgetbase.cpp.
void WidgetBase::setID | ( | Uml::ID::Type | id | ) |
Write property of m_nId.
Definition at line 145 of file widgetbase.cpp.
|
virtual |
Sets the line color.
- Parameters
-
color The new line color
Reimplemented in UMLWidget.
Definition at line 268 of file widgetbase.cpp.
|
virtual |
Sets the line width.
- Parameters
-
width The new line width
Reimplemented in UMLWidget.
Definition at line 310 of file widgetbase.cpp.
|
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, SignalWidget, and PinPortBase.
Definition at line 224 of file widgetbase.cpp.
void WidgetBase::setRect | ( | const QRectF & | rect | ) |
set widget rectangle in item coordinates
Definition at line 619 of file widgetbase.cpp.
void WidgetBase::setRect | ( | qreal | x, |
qreal | y, | ||
qreal | width, | ||
qreal | height | ||
) |
set widget rectangle in item coordinates
Definition at line 631 of file widgetbase.cpp.
|
virtual |
Reimplemented in AssociationWidget, MessageWidget, and UMLWidget.
Definition at line 98 of file widgetbase.cpp.
|
virtual |
Sets the text color.
- Parameters
-
color the new text color
Reimplemented in AssociationWidget, and UMLWidget.
Definition at line 247 of file widgetbase.cpp.
|
virtual |
Sets the UMLObject to represent.
- Parameters
-
obj The object to represent.
Reimplemented in AssociationWidget.
Definition at line 137 of file widgetbase.cpp.
|
virtual |
Set state if fill color is used.
- Parameters
-
state The state to set
Reimplemented in UMLWidget.
Definition at line 331 of file widgetbase.cpp.
void WidgetBase::setUsesDiagramFillColor | ( | bool | state | ) |
Set state if diagram fill color is used.
- Parameters
-
state The state to set
Definition at line 396 of file widgetbase.cpp.
void WidgetBase::setUsesDiagramLineColor | ( | bool | state | ) |
Set state of diagram line color is used.
- Parameters
-
state The state to set
Definition at line 376 of file widgetbase.cpp.
void WidgetBase::setUsesDiagramLineWidth | ( | bool | state | ) |
Set state of diagram line width is used.
- Parameters
-
state The state to set
Definition at line 436 of file widgetbase.cpp.
void WidgetBase::setUsesDiagramTextColor | ( | bool | state | ) |
Set state if diagram text color is used.
- Parameters
-
state The state to set
Definition at line 352 of file widgetbase.cpp.
void WidgetBase::setUsesDiagramUseFillColor | ( | bool | state | ) |
Set state of diagram use fill color is used.
- Parameters
-
state The state to set
Definition at line 416 of file widgetbase.cpp.
|
virtual |
A virtual method for the widget to display a property dialog box.
Subclasses should reimplment this appropriately.
Reimplemented in UMLWidget, AssociationWidget, StateWidget, ActivityWidget, FloatingTextWidget, ObjectNodeWidget, SignalWidget, and ObjectWidget.
Definition at line 462 of file widgetbase.cpp.
|
virtualslot |
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.
Definition at line 757 of file widgetbase.cpp.
QColor WidgetBase::textColor | ( | ) | const |
|
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
Definition at line 987 of file widgetbase.cpp.
UMLDoc * WidgetBase::umlDoc | ( | ) | const |
This is shortcut method for UMLApp::app()->document().
- Returns
- Pointer to the UMLDoc object.
Definition at line 117 of file widgetbase.cpp.
UMLObject * WidgetBase::umlObject | ( | ) | const |
Returns the UMLObject set to represent.
- Returns
- the UMLObject to represent.
Definition at line 127 of file widgetbase.cpp.
UMLScene * WidgetBase::umlScene | ( | ) | const |
Deliver a pointer to the connected UMLView (needed esp.
by event handling of AssociationLine).
Definition at line 107 of file widgetbase.cpp.
bool WidgetBase::useFillColor | ( | ) |
Return state of fill color usage.
- Returns
- True if fill color is used
Definition at line 321 of file widgetbase.cpp.
bool WidgetBase::usesDiagramFillColor | ( | ) | const |
Returns state of diagram fill color is used.
- Returns
- True means diagrams fill color is used
Definition at line 386 of file widgetbase.cpp.
bool WidgetBase::usesDiagramLineColor | ( | ) | const |
Returns state of diagram line color is used.
- Returns
- True means diagrams line color is used
Definition at line 366 of file widgetbase.cpp.
bool WidgetBase::usesDiagramLineWidth | ( | ) | const |
Returns state of diagram line width is used.
- Returns
- True means diagrams line width is used
Definition at line 426 of file widgetbase.cpp.
bool WidgetBase::usesDiagramTextColor | ( | ) | const |
Returns state if diagram text color is used.
- Returns
- True means diagram text color is used
Definition at line 342 of file widgetbase.cpp.
bool WidgetBase::usesDiagramUseFillColor | ( | ) | const |
Returns state of diagram use fill color is used.
- Returns
- True means diagrams fill color is used
Definition at line 406 of file widgetbase.cpp.
Member Data Documentation
|
protected |
Type of widget.
Definition at line 157 of file widgetbase.h.
|
protected |
Definition at line 174 of file widgetbase.h.
|
protected |
Only used if m_umlObject is not set.
Definition at line 160 of file widgetbase.h.
|
protected |
color of the background of the widget
Definition at line 173 of file widgetbase.h.
|
protected |
Definition at line 175 of file widgetbase.h.
|
protected |
Color of the lines of the widget. Is saved to XMI.
Definition at line 172 of file widgetbase.h.
|
protected |
Width of the lines of the widget. Is saved to XMI.
Definition at line 176 of file widgetbase.h.
|
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.
Definition at line 169 of file widgetbase.h.
|
protected |
widget size
Definition at line 162 of file widgetbase.h.
|
protected |
Definition at line 158 of file widgetbase.h.
|
protected |
Definition at line 161 of file widgetbase.h.
|
protected |
Color of the text of the widget. Is saved to XMI.
Definition at line 171 of file widgetbase.h.
|
protected |
Definition at line 159 of file widgetbase.h.
|
protected |
flag indicates if the UMLWidget uses the Diagram FillColour
Definition at line 177 of file widgetbase.h.
|
protected |
Definition at line 186 of file widgetbase.h.
|
protected |
Definition at line 185 of file widgetbase.h.
|
protected |
Definition at line 188 of file widgetbase.h.
|
protected |
true by default, false if the colors have been explicitly set for this widget.
These are saved to XMI.
Definition at line 184 of file widgetbase.h.
|
protected |
Definition at line 187 of file widgetbase.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.