Commit 45d667bb authored by Ralf Habacker's avatar Ralf Habacker

Fix 'Not possible to select notes under a fragment widget in sequence diagrams'

- remove suspicious code handing of setting z value in UMLWidget::setSelected()
  which should be always handled in toForeground()
- disable foreground handling for CombinedFragmentWidget and BoxWidget
  by making toForeground() virtual and adding related overrides.
- set z value for CombinedFragmentWidget to the same level as BoxWidget

There is a remaining issue that a box widget cannot be selected if the
box widget is completly inside a combined fragment widget and created
before the combined fragment widget.

BUG:390509
FIXED-IN:2.24.3 (KDE Applications 17.12.3)
parent 3571fa4e
......@@ -77,3 +77,7 @@ void BoxWidget::showPropertiesDialog()
umlDoc()->setModified(true);
}
}
void BoxWidget::toForeground()
{
}
......@@ -34,6 +34,9 @@ public:
virtual void saveToXMI1(QDomDocument& qDoc, QDomElement& qElement);
virtual void showPropertiesDialog();
protected:
void toForeground();
};
#endif
......@@ -37,6 +37,7 @@
CombinedFragmentWidget::CombinedFragmentWidget(UMLScene * scene, CombinedFragmentType combinedfragmentType, Uml::ID::Type id)
: UMLWidget(scene, WidgetBase::wt_CombinedFragment, id)
{
setZValue(-10);
setCombinedFragmentType(combinedfragmentType);
}
......@@ -471,3 +472,7 @@ void CombinedFragmentWidget::setDashLineGeometryAndPosition() const
m_dashLines.back()->setSize(width(), m_dashLines.back()->height());
}
}
void CombinedFragmentWidget::toForeground()
{
}
......@@ -80,6 +80,7 @@ public slots:
protected:
QSizeF minimumSize() const;
void toForeground();
/// Type of CombinedFragment.
CombinedFragmentType m_CombinedFragment;
......
......@@ -1407,14 +1407,6 @@ void UMLWidget::setSelected(bool _select)
UMLApp::app()->docWindow()->updateDocumentation(true);
}
// TODO: isn't this handled by toForeground() ?
const QPoint pos(x(), y());
UMLWidget *bkgnd = m_scene->widgetAt(pos);
if (bkgnd && bkgnd != this && _select) {
DEBUG(DBG_SRC) << "setting Z to " << bkgnd->zValue() + 1.0 << ", SelectState: " << _select;
setZValue(bkgnd->zValue() + 1.0);
}
update();
// selection changed, we have to make sure the copy and paste items
......
......@@ -274,6 +274,8 @@ protected:
bool wasSizeChanged();
bool wasPositionChanged();
virtual void toForeground();
///////////////// Data Loaded/Saved /////////////////////////////////
QString m_instanceName; ///< instance name (used if on a deployment diagram)
......@@ -334,7 +336,6 @@ protected:
private:
void init();
void toForeground();
/// A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram
mutable AssociationWidgetList m_Assocs;
......
Markdown is supported
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