Dynamic element text item, can have for source of text a composite text, a text composed both by user typed text and element info.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5021 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-08-16 13:52:15 +00:00
parent f94b7a04dd
commit 29748874fd
12 changed files with 416 additions and 24 deletions

View File

@@ -318,6 +318,29 @@ QString QETApp::elementTranslatedInfoKey(const QString &info)
return (info);
}
/**
* @brief QETApp::elementInfoToVar
* @param info
* @return var in form %{my-var} corresponding to the info, if there is not available var for the given info
* the returned var is %{void}
*/
QString QETApp::elementInfoToVar(const QString &info)
{
if (info == "formula") return QString("%{formula}");
else if (info == "label") return QString("%{label}");
else if (info == "comment") return QString("%{comment}");
else if (info == "designation") return QString("%{designation}");
else if (info == "manufacturer") return QString("%{manufacturer}");
else if (info == "manufacturer-reference") return QString("%{manufacturer-reference}");
else if (info == "auxiliary1") return QString("%{auxiliary1}");
else if (info == "auxiliary2") return QString("%{auxiliary2}");
else if (info == "machine-manufacturer-reference") return QString("%{machine-manufacturer-reference}");
else if (info == "location") return QString("%{location}");
else if (info == "function") return QString("%{function}");
return (QString ("%{void}"));
}
/**
@return the common title block templates collection, i.e. the one provided
by QElecrotTech