umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
Enumerations | |
enum | Axis_Type { X , Y } |
enum | Comparison_Type { Smallest , Largest } |
Functions | |
UMLWidget * | findWidget (Uml::ID::Type id, const UMLWidgetList &widgets, const MessageWidgetList *messages) |
QGraphicsRectItem * | decoratePoint (const QPointF &p, QGraphicsItem *parent) |
void | drawCrossInEllipse (QPainter *p, const QRectF &r) |
void | drawTriangledRect (QPainter *painter, const QRectF &rect, const QSizeF &triSize) |
QString | pointToString (const QPointF &point) |
QPointF | stringToPoint (const QString &str) |
bool | loadPixmapFromXMI (QDomElement &pixEle, QPixmap &pixmap) |
void | savePixmapToXMI (QXmlStreamWriter &stream, const QPixmap &pixmap) |
bool | loadGradientFromXMI (QDomElement &gradientElement, QGradient *&gradient) |
void | saveGradientToXMI (QXmlStreamWriter &stream, const QGradient *gradient) |
bool | loadBrushFromXMI (QDomElement &qElement, QBrush &brush) |
void | saveBrushToXMI (QXmlStreamWriter &stream, const QBrush &brush) |
bool | hasSmallerX (const UMLWidget *widget1, const UMLWidget *widget2) |
bool | hasSmallerY (const UMLWidget *widget1, const UMLWidget *widget2) |
Uml::Region::Enum | findRegion (const QRectF &self, const QRectF &other) |
QPointF | prevPoint (int index, const QPolygonF &poly) |
QPointF | nextPoint (int index, const QPolygonF &poly) |
qreal | middle (qreal a, qreal b) |
QLineF | findLine (const QPolygonF &poly, Axis_Type axis, Comparison_Type seek, const QRectF &boundingRect) |
QLineF | closestPoints (const QPolygonF &self, const QPolygonF &other) |
QString | defaultWidgetName (WidgetBase::WidgetType type) |
QString | newTitle (WidgetBase::WidgetType type) |
QString | newText (WidgetBase::WidgetType type) |
QString | renameTitle (WidgetBase::WidgetType type) |
QString | renameText (WidgetBase::WidgetType type) |
void | ensureNestedVisible (UMLWidget *self, UMLWidgetList widgetList) |
QString | adornStereo (QString name, bool appendSpace) |
General purpose widget utilities. Bugs and comments to umbre or llo- devel @kde .orghttps://bugs.kde.org
Auxiliary type for function findLine()
Enumerator | |
---|---|
X | |
Y |
Auxiliary type for function findLine()
Enumerator | |
---|---|
Smallest | |
Largest |
QString Widget_Utils::adornStereo | ( | QString | name, |
bool | appendSpace | ||
) |
Adorn stereotype name with guillemets.
QLineF Widget_Utils::closestPoints | ( | const QPolygonF & | self, |
const QPolygonF & | other | ||
) |
Determine the approximate closest points of two polygons.
self | First QPolygonF. |
other | Second QPolygonF. |
QGraphicsRectItem * Widget_Utils::decoratePoint | ( | const QPointF & | p, |
QGraphicsItem * | parent | ||
) |
Creates the decoration point.
p | base point to decorate |
parent | parent item |
QString Widget_Utils::defaultWidgetName | ( | WidgetBase::WidgetType | type | ) |
Returns a default name for the new widget
type | the widget type |
void Widget_Utils::drawCrossInEllipse | ( | QPainter * | p, |
const QRectF & | r | ||
) |
Calculates and draws a cross inside an ellipse
p | Pointer to a QPainter object. |
r | The rectangle describing the ellipse. |
void Widget_Utils::drawTriangledRect | ( | QPainter * | painter, |
const QRectF & | rect, | ||
const QSizeF & | triSize | ||
) |
Draws a polygon which is almost rectangular except for the top right corner. A triangle is drawn in top right corner of the rectangle.
painter | The painter with which this shape is to be drawn. |
rect | The rectangle dimensions. |
triSize | The size of the triangle in the top-right corner. |
void Widget_Utils::ensureNestedVisible | ( | UMLWidget * | self, |
UMLWidgetList | widgetList | ||
) |
Prevent nested widget(s) located inside the area of a larger widget from disappearing.
self | The widget against which to test the other widgets of the diagram |
widgetList | The widgets of the diagram |
QLineF Widget_Utils::findLine | ( | const QPolygonF & | poly, |
Axis_Type | axis, | ||
Comparison_Type | seek, | ||
const QRectF & | boundingRect | ||
) |
Find the line of poly with the smallest or largest value (controlled by seek) along the axis controlled by axis. In case axis is X, do not consider lines whose Y values lie outside the Y values defined by boundingRect. In case axis is Y, do not consider lines whose X values lie outside the X values defined by boundingRect.
Uml::Region::Enum Widget_Utils::findRegion | ( | const QRectF & | self, |
const QRectF & | other | ||
) |
Find the region in which the rectangle other lies with respect to the rectangle self. Beware that the Qt coordinate system has its origin point (0,0) in the upper left corner with Y values growing downwards, thus the Y related comparisons might look inverted if your are used to the natural coordinate system with (0,0) in the lower left corner.
UMLWidget * Widget_Utils::findWidget | ( | Uml::ID::Type | id, |
const UMLWidgetList & | widgets, | ||
const MessageWidgetList * | messages | ||
) |
Find the widget identified by the given ID in the given widget or message list.
id | The unique ID to find. |
widgets | The UMLWidgetList to search in. |
messages | Optional pointer to a MessageWidgetList to search in. |
Returns true if the first widget's X is smaller than second's. Used for sorting the UMLWidgetList.
widget1 | The widget to compare. |
widget2 | The widget to compare with. |
Returns true if the first widget's Y is smaller than second's. Used for sorting the UMLWidgetList.
widget1 | The widget to compare. |
widget2 | The widget to compare with. |
bool Widget_Utils::loadBrushFromXMI | ( | QDomElement & | qElement, |
QBrush & | brush | ||
) |
Extracts the QBrush properties into brush from the XMI xml element qElement.
qElement | The DOM element from which the xmi info should be extracted. |
brush | The QBrush object into which brush details should be read into. |
bool Widget_Utils::loadGradientFromXMI | ( | QDomElement & | gradientElement, |
QGradient *& | gradient | ||
) |
Loads gradient from xmi. The gradient pointer should be null and the new gradient object will be created inside this method. The gradient should later be deleted externally.
gradientElement | The DOM element from which gradient should be loaded. |
gradient | The pointer to gradient into which the gradient should be loaded. (Allocated inside this method) |
bool Widget_Utils::loadPixmapFromXMI | ( | QDomElement & | pixEle, |
QPixmap & | pixmap | ||
) |
Loads pixmap from xmi.
pixEle | The dom element from which pixmap should be loaded. |
pixmap | The pixmap into which the image should be loaded. |
qreal Widget_Utils::middle | ( | qreal | a, |
qreal | b | ||
) |
Return the middle value between a and b.
QString Widget_Utils::newText | ( | WidgetBase::WidgetType | type | ) |
Returns translated text string used by widget related dialogs
type | widget type |
QString Widget_Utils::newTitle | ( | WidgetBase::WidgetType | type | ) |
Returns translated title string used by widget related dialogs
type | widget type |
QPointF Widget_Utils::nextPoint | ( | int | index, |
const QPolygonF & | poly | ||
) |
Return the point in poly which follows the point at index index. If index is the last index then return the first (or, if poly.isClosed() is true, the second) point.
QString Widget_Utils::pointToString | ( | const QPointF & | point | ) |
Converts a point to a comma separated string i.e "x,y"
point | The QPointF to convert. |
QPointF Widget_Utils::prevPoint | ( | int | index, |
const QPolygonF & | poly | ||
) |
Return the point in poly which precedes the point at index index. If index is 0 then return the last (or, if poly.isClosed() is true, the second to last) point.
QString Widget_Utils::renameText | ( | WidgetBase::WidgetType | type | ) |
Returns translated text string used by widget related dialogs
type | widget type |
QString Widget_Utils::renameTitle | ( | WidgetBase::WidgetType | type | ) |
Returns translated title string used by widget related dialogs
type | widget type |
void Widget_Utils::saveBrushToXMI | ( | QXmlStreamWriter & | stream, |
const QBrush & | brush | ||
) |
Saves the brush info as XMI.
stream | The QXmlStreamWriter object to write to. |
brush | The QBrush whose details should be saved. |
void Widget_Utils::saveGradientToXMI | ( | QXmlStreamWriter & | stream, |
const QGradient * | gradient | ||
) |
Saves gradient information to XMI.
stream | The QXmlStreamWriter object to write to. |
gradient | The gradient to be saved. |
void Widget_Utils::savePixmapToXMI | ( | QXmlStreamWriter & | stream, |
const QPixmap & | pixmap | ||
) |
Saves pixmap information to XMI.
stream | The QXmlStreamWriter object to write to. |
pixmap | The pixmap to be saved. |
QPointF Widget_Utils::stringToPoint | ( | const QString & | str | ) |
Converts a comma separated string to point.