List to speed up reading a template by many pieces.
--HG-- branch : feature
This commit is contained in:
parent
882cf360e2
commit
3b60eaff08
|
@ -194,6 +194,7 @@ const QString VAbstractPattern::NodeSpline = QStringLiteral("NodeSpline");
|
|||
const QString VAbstractPattern::NodeSplinePath = QStringLiteral("NodeSplinePath");
|
||||
|
||||
QHash<quint32, VDataTool*> VAbstractPattern::tools = QHash<quint32, VDataTool*>();
|
||||
QVector<VLabelTemplateLine> VAbstractPattern::patternLabelLines = QVector<VLabelTemplateLine>();
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -1381,17 +1382,24 @@ void VAbstractPattern::SetPatternLabelTemplate(const QVector<VLabelTemplateLine>
|
|||
QDomElement tag = CheckTagExists(TagPatternLabel);
|
||||
RemoveAllChildren(tag);
|
||||
SetLabelTemplate(tag, lines);
|
||||
patternLabelLines = lines;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<VLabelTemplateLine> VAbstractPattern::GetPatternLabelTemplate() const
|
||||
{
|
||||
const QDomNodeList list = elementsByTagName(TagPatternLabel);
|
||||
if (list.isEmpty())
|
||||
if (patternLabelLines.isEmpty())
|
||||
{
|
||||
return QVector<VLabelTemplateLine>();
|
||||
const QDomNodeList list = elementsByTagName(TagPatternLabel);
|
||||
if (list.isEmpty())
|
||||
{
|
||||
return QVector<VLabelTemplateLine>();
|
||||
}
|
||||
|
||||
patternLabelLines = GetLabelTemplate(list.at(0).toElement());
|
||||
}
|
||||
return GetLabelTemplate(list.at(0).toElement());
|
||||
|
||||
return patternLabelLines;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -387,6 +387,8 @@ protected:
|
|||
|
||||
/** @brief tools list with pointer on tools. */
|
||||
static QHash<quint32, VDataTool*> tools;
|
||||
/** @brief patternLabelLines list to speed up reading a template by many pieces. */
|
||||
static QVector<VLabelTemplateLine> patternLabelLines;
|
||||
|
||||
static void ToolExists(const quint32 &id);
|
||||
static VPiecePath ParsePathNodes(const QDomElement &domElement);
|
||||
|
|
Loading…
Reference in New Issue
Block a user