Update label after changing date/time format.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-19 19:52:33 +03:00
parent 6d06370f4f
commit 464a54c7ee
7 changed files with 9 additions and 6 deletions

View File

@ -1349,6 +1349,7 @@ void VAbstractPattern::SetLabelDateFormat(const QString &format)
{ {
QDomElement tag = CheckTagExists(TagPatternLabel); QDomElement tag = CheckTagExists(TagPatternLabel);
SetAttribute(tag, AttrDateFormat, format); SetAttribute(tag, AttrDateFormat, format);
patternLabelWasChanged = true;
modified = true; modified = true;
emit patternChanged(false); emit patternChanged(false);
} }
@ -1373,6 +1374,7 @@ void VAbstractPattern::SetLabelTimeFormat(const QString &format)
{ {
QDomElement tag = CheckTagExists(TagPatternLabel); QDomElement tag = CheckTagExists(TagPatternLabel);
SetAttribute(tag, AttrTimeFormat, format); SetAttribute(tag, AttrTimeFormat, format);
patternLabelWasChanged = true;
modified = true; modified = true;
emit patternChanged(false); emit patternChanged(false);
} }

View File

@ -543,7 +543,7 @@ QStringList VLayoutPiece::GetPatternText() const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::SetPatternInfo(const VAbstractPattern* pDoc, const VPatternLabelData& geom, const QFont &font, void VLayoutPiece::SetPatternInfo(VAbstractPattern* pDoc, const VPatternLabelData& geom, const QFont &font,
const VContainer *pattern) const VContainer *pattern)
{ {
QPointF ptPos; QPointF ptPos;

View File

@ -95,7 +95,7 @@ public:
QPointF GetPatternTextPosition() const; QPointF GetPatternTextPosition() const;
QStringList GetPatternText() const; QStringList GetPatternText() const;
void SetPatternInfo(const VAbstractPattern* pDoc, const VPatternLabelData& geom, const QFont& font, void SetPatternInfo(VAbstractPattern *pDoc, const VPatternLabelData& geom, const QFont& font,
const VContainer *pattern); const VContainer *pattern);
void SetGrainline(const VGrainlineData& geom, const VContainer *pattern); void SetGrainline(const VGrainlineData& geom, const VContainer *pattern);

View File

@ -346,7 +346,7 @@ void VTextManager::Update(const QString& qsName, const VPieceLabelData& data)
* @brief VTextManager::Update updates the text lines with pattern info * @brief VTextManager::Update updates the text lines with pattern info
* @param pDoc pointer to the abstract pattern object * @param pDoc pointer to the abstract pattern object
*/ */
void VTextManager::Update(const VAbstractPattern *pDoc) void VTextManager::Update(VAbstractPattern *pDoc)
{ {
m_liLines.clear(); m_liLines.clear();
@ -365,6 +365,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc)
lines[i].line = ReplacePlaceholders(placeholders, lines.at(i).line); lines[i].line = ReplacePlaceholders(placeholders, lines.at(i).line);
} }
pDoc->SetPatternWasChanged(false);
m_patternLabelLines = PrepareLines(lines); m_patternLabelLines = PrepareLines(lines);
} }

View File

@ -84,7 +84,7 @@ public:
const TextLine& GetSourceLine(int i) const; const TextLine& GetSourceLine(int i) const;
void Update(const QString& qsName, const VPieceLabelData& data); void Update(const QString& qsName, const VPieceLabelData& data);
void Update(const VAbstractPattern* pDoc); void Update(VAbstractPattern* pDoc);
private: private:
QFont m_font; QFont m_font;

View File

@ -343,7 +343,7 @@ void VTextGraphicsItem::UpdateData(const QString &qsName, const VPieceLabelData
* @brief VTextGraphicsItem::UpdateData Updates the pattern label * @brief VTextGraphicsItem::UpdateData Updates the pattern label
* @param pDoc pointer to the pattern object * @param pDoc pointer to the pattern object
*/ */
void VTextGraphicsItem::UpdateData(const VAbstractPattern* pDoc) void VTextGraphicsItem::UpdateData(VAbstractPattern* pDoc)
{ {
m_tm.Update(pDoc); m_tm.Update(pDoc);
} }

View File

@ -66,7 +66,7 @@ public:
void SetSize(qreal fW, qreal fH); void SetSize(qreal fW, qreal fH);
bool IsContained(QRectF rectBB, qreal dRot, qreal& dX, qreal& dY) const; bool IsContained(QRectF rectBB, qreal dRot, qreal& dX, qreal& dY) const;
void UpdateData(const QString& qsName, const VPieceLabelData& data); void UpdateData(const QString& qsName, const VPieceLabelData& data);
void UpdateData(const VAbstractPattern* pDoc); void UpdateData(VAbstractPattern* pDoc);
int GetTextLines() const; int GetTextLines() const;
protected: protected: