Skip to content
Commit 3360998e authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

(In reply to Ralf Habacker from comment #9)

> Comment on attachment 83576 [details]
> Similar example for instantiated template class
>
> Here using correct widget shape for line intersecting would solve the issue.

Here is an implementation for corrected widget shape of template classes.
However, apparently Widget_Utils::closestPoints() still has a bug related to
anchoring in the NorthWest, West, and SouthWest regions; I'll look into that
next.

umbrello/widgets/umlwidget.{h,cpp}
- At function calculateSize() add optional bool argument `withExtensions'
  defaulting to true.
- At functions calculateSize(), minimumSize(), and getFontMetrics(), add
  `const' qualifier to enable use in overriding QGraphicsItem::shape().
- In function init() add allocation of the m_pFontMetrics array elements.
  Reason: Ad hoc allocation of m_pFontMetrics element is removed from
  getFontMetrics() in order to make that method `const'.
- In function forceUpdateFontMetrics() for-loops let loop variable count
  backwards so that m_font ends up initialized to FT_NORMAL (index 0.)

umbrello/widgets/classifierwidget.{h,cpp}
- UMLWidget overriding function calculateSize() assumes minimumSize() body.
  If `withExtensions' arg is true then size is calculated to include
  template box; else size does not include template box.
- Function minimumSize() now simply calls calculateSize() using default
  withExtensions argument.
- Declare following functions `const':
  calculateTemplatesBoxSize(), calculateAsCircleSize(), minimumSize(),
  displayedMembers(), displayedAttributes(), displayedOperations().
  This is required due to their usage in overriding QGraphicsItem::shape().
- In function paint() rename m_bodyOffsetY to bodyOffsetY.
  Reason: This is a local variable not a class member.
- In function shape(), if calculateTemplatesBoxSize() returns non-zero then
  add the templates box rectangle to the path, and displace the main
  rectangle by a postive Y offset of templatesBoxSize.height() minus MARGIN.

umbrello/widgets/notewidget.{h,cpp}
- Adjust calculateSize() override to changed signature in UMLWidget.

umbrello/widgets/activitywidget.{h,cpp}
umbrello/widgets/actorwidget.{h,cpp}
umbrello/widgets/artifactwidget.{h,cpp}
umbrello/widgets/categorywidget.{h,cpp}
umbrello/widgets/combinedfragmentwidget.{h,cpp}
umbrello/widgets/componentwidget.{h,cpp}
umbrello/widgets/datatypewidget.{h,cpp}
umbrello/widgets/entitywidget.{h,cpp}
umbrello/widgets/enumwidget.{h,cpp}
umbrello/widgets/floatingtextwidget.{h,cpp}
umbrello/widgets/forkjoinwidget.{h,cpp}
umbrello/widgets/nodewidget.{h,cpp}
umbrello/widgets/notewidget.{h,cpp}
umbrello/widgets/usecasewidget.{h,cpp}
umbrello/widgets/objectnodewidget.{h,cpp}
umbrello/widgets/objectwidget.{h,cpp}
umbrello/widgets/packagewidget.{h,cpp}
umbrello/widgets/preconditionwidget.{h,cpp}
umbrello/widgets/regionwidget.{h,cpp}
umbrello/widgets/signalwidget.{h,cpp}
umbrello/widgets/statewidget.{h,cpp}
umbrello/widgets/umlwidget.{h,cpp}
- Adjust minimumSize() override to changed signature in UMLWidget.

umbrello/widgets/associationwidget.cpp
- In function calculateEndingPoints(), apply
    QPolygonF::translated(pWidgetA->pos()) on polyA
  and apply
    QPolygonF::translated(pWidgetB->pos()) on polyB
  to properly handle non child widgets (i.e. with absolute pos().)
- In function updateRegionLineCount(), for calculating `pt' employ
  Widget_Utils::closestPoints() following the pattern used in
  calculateEndingPoints().

umbrello/widgets/widget_utils.cpp
- New function middle() returns the middle value of two axis values.
  The function handles not only relative but also absolute coordinates.
- In function closestPoints() employ function middle() in the
  result.setLine() arguments for regions North, South, West, and East.

CCBUG:128351
parent bc4c017f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment