mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Reworked the DiagramContext class to sort custom variables.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1884 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1316,13 +1316,13 @@ QString TitleBlockTemplate::finalTextForCell(const TitleBlockCell &cell, const D
|
||||
}
|
||||
|
||||
/**
|
||||
@param string A text containing 0 to n variables, e.g. "%var" or "%{var}"
|
||||
@param diagram_context Diagram context to use to interprete variables
|
||||
@return the provided string with variables replaced by the values from the diagram context
|
||||
@param string A text containing 0 to n variables, e.g. "%var" or "%{var}"
|
||||
@param diagram_context Diagram context to use to interprete variables
|
||||
@return the provided string with variables replaced by the values from the diagram context
|
||||
*/
|
||||
QString TitleBlockTemplate::interpreteVariables(const QString &string, const DiagramContext &diagram_context) const {
|
||||
QString interpreted_string = string;
|
||||
foreach (QString key, diagram_context.keys()) {
|
||||
foreach (QString key, diagram_context.keys(DiagramContext::DecreasingLength)) {
|
||||
interpreted_string.replace("%{" + key + "}", diagram_context[key].toString());
|
||||
interpreted_string.replace("%" + key, diagram_context[key].toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user