Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SDK
Umbrello
Commits
62ff3886
Commit
62ff3886
authored
Oct 24, 2019
by
Ralf Habacker
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Auto create attributes on adding aggregations and compositions
parent
cc11848d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
umbrello/toolbarstateassociation.cpp
umbrello/toolbarstateassociation.cpp
+14
-0
No files found.
umbrello/toolbarstateassociation.cpp
View file @
62ff3886
...
...
@@ -16,6 +16,7 @@
#include "association.h"
#include "associationline.h"
#include "associationwidget.h"
#include "classifier.h"
#include "classifierwidget.h"
#include "cmds/widget/cmdcreatewidget.h"
#include "floatingtextwidget.h"
...
...
@@ -236,6 +237,19 @@ void ToolBarStateAssociation::setSecondWidget()
widgetA
->
updateGeometry
();
if
(
widgetB
->
changesShape
())
widgetB
->
updateGeometry
();
if
(
widgetA
->
isClassWidget
()
&&
widgetB
->
isClassWidget
())
{
if
(
temp
->
associationType
()
==
Uml
::
AssociationType
::
Composition
)
{
UMLClassifier
*
c
=
widgetA
->
umlObject
()
->
asUMLClassifier
();
UMLAttribute
*
attr
=
new
UMLAttribute
(
c
,
c
->
uniqChildName
(
UMLObject
::
ot_Attribute
));
attr
->
setType
(
widgetB
->
umlObject
());
c
->
addAttribute
(
attr
);
}
else
if
(
temp
->
associationType
()
==
Uml
::
AssociationType
::
Aggregation
)
{
UMLClassifier
*
c
=
widgetA
->
umlObject
()
->
asUMLClassifier
();
UMLAttribute
*
attr
=
new
UMLAttribute
(
c
,
c
->
uniqChildName
(
UMLObject
::
ot_Attribute
));
attr
->
setTypeName
(
QString
(
QLatin1String
(
"%1*"
)).
arg
(
widgetB
->
umlObject
()
->
name
()));
c
->
addAttribute
(
attr
);
}
}
FloatingTextWidget
*
wt
=
temp
->
textWidgetByRole
(
Uml
::
TextRole
::
Coll_Message
);
if
(
wt
)
wt
->
showOperationDialog
();
...
...
Oliver Kellogg
@okellogg
mentioned in commit
2bb95adc
·
Oct 30, 2020
mentioned in commit
2bb95adc
mentioned in commit 2bb95adcdac2b4211466fd1d7bc5425f89e12752
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment