Element selector widget: minor improvement

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3420 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-10-30 13:57:54 +00:00
parent 6b40932bb4
commit b7a3d25eb9

View File

@@ -109,10 +109,20 @@ void ElementSelectorWidget::buildInterface() {
foreach (Element *elmt, elements_list) {
//label for the button
QString button_text;
//if element is master and have label, add label to the string
//Also to comment
if (elmt->linkType() & Element::Master) {
QString label = elmt->elementInformations()["label"].toString();
if (!label.isEmpty()) button_text += (label + " ");
DiagramContext dc = elmt -> elementInformations();
if (!dc["label"].toString().isEmpty())
button_text = dc["label"].toString() + " ";
if (!dc["comment"].toString().isEmpty())
button_text += dc["comment"].toString();
if (!button_text.isEmpty())
button_text += "\n";
}
QString title = elmt->diagram()->title();