Removed printf commands, added Q_REQUIRED_RESULT macros, replaced v[i] with v.at(i) where needed, replaced 1,0 with true,false when creating boolean XML attributes
--HG-- branch : feature
This commit is contained in:
parent
0e7b369c2e
commit
455befa493
|
@ -1002,7 +1002,7 @@ QString VAbstractPattern::GetPatternName() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VAbstractPattern::SetPatternName(QString qsName)
|
void VAbstractPattern::SetPatternName(const QString &qsName)
|
||||||
{
|
{
|
||||||
CheckTagExists(TagPatternName);
|
CheckTagExists(TagPatternName);
|
||||||
setTagText(TagPatternName, qsName);
|
setTagText(TagPatternName, qsName);
|
||||||
|
@ -1017,7 +1017,7 @@ QString VAbstractPattern::GetCompanyName() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VAbstractPattern::SetCompanyName(QString qsName)
|
void VAbstractPattern::SetCompanyName(const QString& qsName)
|
||||||
{
|
{
|
||||||
CheckTagExists(TagCompanyName);
|
CheckTagExists(TagCompanyName);
|
||||||
setTagText(TagCompanyName, qsName);
|
setTagText(TagCompanyName, qsName);
|
||||||
|
@ -1032,7 +1032,7 @@ QString VAbstractPattern::GetPatternNumber() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VAbstractPattern::SetPatternNumber(QString qsNum)
|
void VAbstractPattern::SetPatternNumber(const QString& qsNum)
|
||||||
{
|
{
|
||||||
CheckTagExists(TagPatternNum);
|
CheckTagExists(TagPatternNum);
|
||||||
setTagText(TagPatternNum, qsNum);
|
setTagText(TagPatternNum, qsNum);
|
||||||
|
@ -1047,7 +1047,7 @@ QString VAbstractPattern::GetCustomerName() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VAbstractPattern::SetCustomerName(QString qsName)
|
void VAbstractPattern::SetCustomerName(const QString& qsName)
|
||||||
{
|
{
|
||||||
CheckTagExists(TagCustomerName);
|
CheckTagExists(TagCustomerName);
|
||||||
setTagText(TagCustomerName, qsName);
|
setTagText(TagCustomerName, qsName);
|
||||||
|
@ -1062,7 +1062,7 @@ QString VAbstractPattern::GetPatternSize() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VAbstractPattern::SetPatternSize(QString qsSize)
|
void VAbstractPattern::SetPatternSize(const QString& qsSize)
|
||||||
{
|
{
|
||||||
CheckTagExists(TagSize);
|
CheckTagExists(TagSize);
|
||||||
setTagText(TagSize, qsSize);
|
setTagText(TagSize, qsSize);
|
||||||
|
|
|
@ -109,15 +109,15 @@ public:
|
||||||
void SetNotes(const QString &text);
|
void SetNotes(const QString &text);
|
||||||
|
|
||||||
QString GetPatternName() const;
|
QString GetPatternName() const;
|
||||||
void SetPatternName(QString qsName);
|
void SetPatternName(const QString& qsName);
|
||||||
QString GetCompanyName() const;
|
QString GetCompanyName() const;
|
||||||
void SetCompanyName(QString qsName);
|
void SetCompanyName(const QString& qsName);
|
||||||
QString GetPatternNumber() const;
|
QString GetPatternNumber() const;
|
||||||
void SetPatternNumber(QString qsNum);
|
void SetPatternNumber(const QString &qsNum);
|
||||||
QString GetCustomerName() const;
|
QString GetCustomerName() const;
|
||||||
void SetCustomerName(QString qsName);
|
void SetCustomerName(const QString& qsName);
|
||||||
QString GetPatternSize() const;
|
QString GetPatternSize() const;
|
||||||
void SetPatternSize(QString qsSize);
|
void SetPatternSize(const QString &qsSize);
|
||||||
bool IsDateVisible() const;
|
bool IsDateVisible() const;
|
||||||
void SetDateVisible(bool bVisible);
|
void SetDateVisible(bool bVisible);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
||||||
# include "../vmisc/vmath.h"
|
# include "../vmisc/vmath.h"
|
||||||
|
@ -159,7 +158,7 @@ void VLayoutDetail::SetPatternInfo(const VAbstractPattern* pDoc, const VPatternI
|
||||||
<< QPointF(ptPos.x(), ptPos.y() + geom.GetLabelHeight());
|
<< QPointF(ptPos.x(), ptPos.y() + geom.GetLabelHeight());
|
||||||
for (int i = 0; i < v.count(); ++i)
|
for (int i = 0; i < v.count(); ++i)
|
||||||
{
|
{
|
||||||
v[i] = RotatePoint(ptCenter, v[i], dAng);
|
v[i] = RotatePoint(ptCenter, v.at(i), dAng);
|
||||||
}
|
}
|
||||||
d->patternInfo = RoundPoints(v);
|
d->patternInfo = RoundPoints(v);
|
||||||
|
|
||||||
|
@ -543,7 +542,6 @@ void VLayoutDetail::CreateTextItems()
|
||||||
qreal dW = GetDistance(points.at(0), points.at(1));
|
qreal dW = GetDistance(points.at(0), points.at(1));
|
||||||
qreal dY = 0;
|
qreal dY = 0;
|
||||||
qreal dX;
|
qreal dX;
|
||||||
printf("Pattern lines %d %d\n", m_tmPattern.GetCount(), m_tmPattern.GetSourceLineCount());
|
|
||||||
for (int i = 0; i < m_tmPattern.GetCount(); ++i)
|
for (int i = 0; i < m_tmPattern.GetCount(); ++i)
|
||||||
{
|
{
|
||||||
const TextLine& tl = m_tmPattern.GetLine(i);
|
const TextLine& tl = m_tmPattern.GetLine(i);
|
||||||
|
|
|
@ -88,8 +88,8 @@ public:
|
||||||
QPainterPath ContourPath() const;
|
QPainterPath ContourPath() const;
|
||||||
void ClearTextItems();
|
void ClearTextItems();
|
||||||
void CreateTextItems();
|
void CreateTextItems();
|
||||||
int GetTextItemsCount() const;
|
int GetTextItemsCount() const Q_REQUIRED_RESULT;
|
||||||
QGraphicsItem* GetTextItem(int i) const;
|
QGraphicsItem* GetTextItem(int i) const Q_REQUIRED_RESULT;
|
||||||
QPainterPath LayoutAllowencePath() const;
|
QPainterPath LayoutAllowencePath() const;
|
||||||
QGraphicsItem *GetItem() const Q_REQUIRED_RESULT;
|
QGraphicsItem *GetItem() const Q_REQUIRED_RESULT;
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ void SaveDetailOptions::SavePatternPieceData(QDomElement &domElement, const VDet
|
||||||
QDomElement domData = doc->createElement(VAbstractPattern::TagData);
|
QDomElement domData = doc->createElement(VAbstractPattern::TagData);
|
||||||
const VPatternPieceData& data = det.GetPatternPieceData();
|
const VPatternPieceData& data = det.GetPatternPieceData();
|
||||||
doc->SetAttribute(domData, VAbstractPattern::AttrLetter, data.GetLetter());
|
doc->SetAttribute(domData, VAbstractPattern::AttrLetter, data.GetLetter());
|
||||||
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, data.IsVisible() == true? 1:0);
|
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, data.IsVisible() == true? trueStr : falseStr);
|
||||||
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
|
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
|
||||||
doc->SetAttribute(domData, AttrMy, data.GetPos().y());
|
doc->SetAttribute(domData, AttrMy, data.GetPos().y());
|
||||||
doc->SetAttribute(domData, VToolDetail::AttrWidth, data.GetLabelWidth());
|
doc->SetAttribute(domData, VToolDetail::AttrWidth, data.GetLabelWidth());
|
||||||
|
@ -165,7 +165,7 @@ void SaveDetailOptions::SavePatternInfo(QDomElement &domElement, const VDetail &
|
||||||
{
|
{
|
||||||
QDomElement domData = doc->createElement(VAbstractPattern::TagPatternInfo);
|
QDomElement domData = doc->createElement(VAbstractPattern::TagPatternInfo);
|
||||||
const VPatternInfoGeometry& data = det.GetPatternInfo();
|
const VPatternInfoGeometry& data = det.GetPatternInfo();
|
||||||
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, data.IsVisible() == true? 1:0);
|
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, data.IsVisible() == true? trueStr : falseStr);
|
||||||
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
|
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
|
||||||
doc->SetAttribute(domData, AttrMy, data.GetPos().y());
|
doc->SetAttribute(domData, AttrMy, data.GetPos().y());
|
||||||
doc->SetAttribute(domData, VToolDetail::AttrWidth, data.GetLabelWidth());
|
doc->SetAttribute(domData, VToolDetail::AttrWidth, data.GetLabelWidth());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user