diff options
author | Félix Simas de Souza Neto <fn.simas@gmail.com> | 2013-11-21 21:10:53 -0300 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-11-22 18:04:44 +0100 |
commit | 1de3f3970c6180f509b4f37e8863a6b651e0b399 (patch) | |
tree | 4799562c950ebeafae5977db6034b529f8475867 /examples/uml | |
parent | 42eb8d038180d5e8486a8234301934bd93ae0ae6 (diff) |
Edit file UmlClass.qml
Add one function that return the type of parameters
Change-Id: I682fa529495c5d053848897345b8629a50020a0b
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'examples/uml')
-rw-r--r-- | examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml index 7e6106ee..bb85764a 100644 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml +++ b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml @@ -70,7 +70,7 @@ UmlElement { model: element.ownedOperations anchors { fill: parent; margins: 4 } delegate: Text { - text: visibility(modelData.visibility) + modelData.name + text: visibility(modelData.visibility) + modelData.name + operationSignature(model) font { family: "Korolev" } } } @@ -85,4 +85,23 @@ UmlElement { case 4: return "~" } } + function operationSignature(model) + { + var generalString = "("; + var returnString = ": "; + var list = element.ownedOperations[model.index].ownedParameters; + var count = list.length; + for (var i = 0; i < count ; ++i) + { + if (list[i].direction === 4) + returnString = returnString + list[i].type.name; + else + generalString = generalString + list[i].type.name + ", "; + } + if (returnString == ": ") + returnString = returnString + "void"; + generalString = generalString + ")" + returnString; + generalString = generalString.replace(', )',')'); + return generalString; + } } |