Commit a37f2c1e authored by Ralf Habacker's avatar Ralf Habacker

Move the code to select appropriate widgets to the AssociationWidgetRole class

CCBUG:53369
parent abd178af
......@@ -3704,18 +3704,9 @@ void AssociationWidget::setSelected(bool _select /* = true */)
WidgetBase::setSelected(_select);
if ( m_nameWidget)
m_nameWidget->setSelected( _select );
if ( m_role[RoleType::A].roleWidget )
m_role[RoleType::A].roleWidget->setSelected( _select );
if ( m_role[RoleType::B].roleWidget )
m_role[RoleType::B].roleWidget->setSelected( _select );
if ( m_role[RoleType::A].multiplicityWidget )
m_role[RoleType::A].multiplicityWidget->setSelected( _select );
if ( m_role[RoleType::B].multiplicityWidget )
m_role[RoleType::B].multiplicityWidget->setSelected( _select );
if ( m_role[RoleType::A].changeabilityWidget)
m_role[RoleType::A].changeabilityWidget->setSelected( _select );
if ( m_role[RoleType::B].changeabilityWidget)
m_role[RoleType::B].changeabilityWidget->setSelected( _select );
m_role[RoleType::A].setSelected(_select);
m_role[RoleType::B].setSelected(_select);
// Update the docwindow for this association.
// This is done last because each of the above setSelected calls
......
......@@ -76,3 +76,18 @@ UMLWidget* AssociationWidgetRole::onWidget(const QPointF &p)
return roleWidget;
return nullptr;
}
/**
* Sets the state of whether the widget is selected.
*
* @param _select The state of whether the widget is selected.
*/
void AssociationWidgetRole::setSelected(bool select)
{
if (roleWidget)
roleWidget->setSelected(select);
if (multiplicityWidget )
multiplicityWidget->setSelected(select);
if (changeabilityWidget)
changeabilityWidget->setSelected(select);
}
......@@ -52,6 +52,7 @@ public:
void setFont(const QFont &font);
UMLWidget *onWidget(const QPointF &p);
void setSelected(bool select);
private:
AssociationWidget *m_q;
......
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