Commit eeb05c5a authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix bug not displaying stereotypes on use case associations.

parent 59e4669d
......@@ -225,8 +225,12 @@ void AssociationGeneralPage::apply()
m_pAssociationWidget->setDocumentation(m_doc->toPlainText());
if (m_pStereoChkB && m_pStereoChkB->isChecked()) {
QString stereo = m_pAssocNameComB->currentText();
// keep the order
m_pAssociationWidget->setName(QLatin1String(""));
m_pAssociationWidget->setStereotype(stereo);
} else {
// keep the order
m_pAssociationWidget->setStereotype(QLatin1String(""));
m_pAssociationWidget->setName(m_pAssocNameLE->text());
}
}
......
......@@ -952,10 +952,19 @@ void AssociationWidget::setStereotype(const QString &stereo) {
UMLAssociation *umlassoc = association();
if (umlassoc) {
umlassoc->setStereotype(stereo);
if (m_nameWidget) {
m_nameWidget->setText(umlassoc->stereotype(true));
if (!m_nameWidget) {
QString text = umlassoc->stereotype(true);
// Don't construct the FloatingTextWidget if the string is empty.
if (! FloatingTextWidget::isTextValid(text))
return;
m_nameWidget = new FloatingTextWidget(m_scene, calculateNameType(Uml::TextRole::Name), text);
m_nameWidget->setParentItem(this);
m_nameWidget->setLink(this);
m_nameWidget->activate();
setTextPosition(calculateNameType(Uml::TextRole::Name));
} else {
uDebug() << "not setting " << stereo << " because m_nameWidget is NULL";
m_nameWidget->setText(umlassoc->stereotype(true));
}
} else {
uDebug() << "not setting " << stereo << " because association is NULL";
......
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