Show Notes field for all draw mode tools in the property browser.

This commit is contained in:
Roman Telezhynskyi 2020-10-28 11:52:07 +02:00
parent de401b2d06
commit 460683c942
9 changed files with 866 additions and 342 deletions

File diff suppressed because it is too large Load Diff

View File

@ -67,31 +67,64 @@ private:
void ShowItemOptions(QGraphicsItem *item); void ShowItemOptions(QGraphicsItem *item);
template<class Tool> template<class Tool>
void SetPointName(const QString &name); void SetPointName(VPE::VProperty *property);
template<class Tool> template<class Tool>
void SetPointName1(const QString &name); void SetPointName1(VPE::VProperty *property);
template<class Tool> template<class Tool>
void SetPointName2(const QString &name); void SetPointName2(VPE::VProperty *property);
template<class Tool> template<class Tool>
void SetOperationSuffix(const QString &suffix); void SetOperationSuffix(VPE::VProperty *property);
template<class Type> template<class Type>
Type GetCrossPoint(const QVariant &value); Type GetCrossPoint(const QVariant &value);
template<class Tool> template<class Tool>
void SetCrossCirclesPoint(const QVariant &value); void SetCrossCirclesPoint(VPE::VProperty *property);
template<class Tool> template<class Tool>
void SetVCrossCurvesPoint(const QVariant &value); void SetVCrossCurvesPoint(VPE::VProperty *property);
template<class Tool> template<class Tool>
void SetHCrossCurvesPoint(const QVariant &value); void SetHCrossCurvesPoint(VPE::VProperty *property);
template<class Tool> template<class Tool>
void SetAxisType(const QVariant &value); void SetAxisType(VPE::VProperty *property);
template<class Tool>
void SetNotes(VPE::VProperty *property);
template<class Tool>
void SetLineType(VPE::VProperty *property);
template<class Tool>
void SetLineColor(VPE::VProperty *property);
template<class Tool>
void SetFormulaLength(VPE::VProperty *property);
template<class Tool>
void SetFormulaAngle(VPE::VProperty *property);
template<class Tool>
void SetFormulaRadius(VPE::VProperty *property);
template<class Tool>
void SetFormulaF1(VPE::VProperty *property);
template<class Tool>
void SetFormulaF2(VPE::VProperty *property);
template<class Tool>
void SetPenStyle(VPE::VProperty *property);
template<class Tool>
void SetFormulaRotationAngle(VPE::VProperty *property);
template<class Tool>
void SetApproximationScale(VPE::VProperty *property);
template<class Tool> template<class Tool>
void AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly = false); void AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly = false);
@ -131,6 +164,7 @@ private:
void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName); void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName);
void AddPropertyParentPointName(const QString &pointName, const QString &propertyName, void AddPropertyParentPointName(const QString &pointName, const QString &propertyName,
const QString &propertyAttribure); const QString &propertyAttribure);
void AddPropertyText(const QString &propertyName, const QString &text, const QString &attrName);
QStringList PropertiesList() const; QStringList PropertiesList() const;

View File

@ -808,7 +808,7 @@ QDomElement VPatternRecipe::CutArc(const VToolRecord &record)
QDomElement step = createElement(TagStep); QDomElement step = createElement(TagStep);
ToolAttributes(step, tool); ToolAttributes(step, tool);
Formula(step, tool->GetFormula(), AttrLength, AttrLengthValue); Formula(step, tool->GetFormulaLength(), AttrLength, AttrLengthValue);
SetAttribute(step, AttrArc, tool->CurveName()); SetAttribute(step, AttrArc, tool->CurveName());
return step; return step;
@ -822,7 +822,7 @@ QDomElement VPatternRecipe::CutSpline(const VToolRecord &record)
QDomElement step = createElement(TagStep); QDomElement step = createElement(TagStep);
ToolAttributes(step, tool); ToolAttributes(step, tool);
Formula(step, tool->GetFormula(), AttrLength, AttrLengthValue); Formula(step, tool->GetFormulaLength(), AttrLength, AttrLengthValue);
SetAttribute(step, VToolCutSpline::AttrSpline, tool->CurveName()); SetAttribute(step, VToolCutSpline::AttrSpline, tool->CurveName());
return step; return step;
@ -836,7 +836,7 @@ QDomElement VPatternRecipe::CutSplinePath(const VToolRecord &record)
QDomElement step = createElement(TagStep); QDomElement step = createElement(TagStep);
ToolAttributes(step, tool); ToolAttributes(step, tool);
Formula(step, tool->GetFormula(), AttrLength, AttrLengthValue); Formula(step, tool->GetFormulaLength(), AttrLength, AttrLengthValue);
SetAttribute(step, VToolCutSplinePath::AttrSplinePath, tool->CurveName()); SetAttribute(step, VToolCutSplinePath::AttrSplinePath, tool->CurveName());
return step; return step;

View File

@ -78,7 +78,7 @@ void VToolCut::FullUpdateFromFile()
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VFormula VToolCut::GetFormula() const VFormula VToolCut::GetFormulaLength() const
{ {
VFormula val(formula, getData()); VFormula val(formula, getData());
val.setCheckZero(true); val.setCheckZero(true);
@ -89,7 +89,7 @@ VFormula VToolCut::GetFormula() const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VToolCut::SetFormula(const VFormula &value) void VToolCut::SetFormulaLength(const VFormula &value)
{ {
if (value.error() == false) if (value.error() == false)
{ {

View File

@ -54,8 +54,8 @@ public:
virtual int type() const override {return Type;} virtual int type() const override {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Cut)}; enum { Type = UserType + static_cast<int>(Tool::Cut)};
VFormula GetFormula() const; VFormula GetFormulaLength() const;
void SetFormula(const VFormula &value); void SetFormulaLength(const VFormula &value);
QString CurveName() const; QString CurveName() const;

View File

@ -273,7 +273,7 @@ QString VDrawTool::getLineType() const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VDrawTool::SetTypeLine(const QString &value) void VDrawTool::SetLineType(const QString &value)
{ {
m_lineType = value; m_lineType = value;

View File

@ -75,7 +75,7 @@ public:
virtual ~VDrawTool() Q_DECL_EQ_DEFAULT; virtual ~VDrawTool() Q_DECL_EQ_DEFAULT;
QString getLineType() const; QString getLineType() const;
virtual void SetTypeLine(const QString &value); virtual void SetLineType(const QString &value);
virtual bool IsLabelVisible(quint32 id) const; virtual bool IsLabelVisible(quint32 id) const;

View File

@ -475,7 +475,7 @@ void VToolLine::ShowVisualization(bool show)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VToolLine::SetTypeLine(const QString &value) void VToolLine::SetLineType(const QString &value)
{ {
m_lineType = value; m_lineType = value;

View File

@ -87,7 +87,7 @@ public:
virtual void ShowVisualization(bool show) override; virtual void ShowVisualization(bool show) override;
virtual void SetTypeLine(const QString &value) override; virtual void SetLineType(const QString &value) override;
virtual void GroupVisibility(quint32 object, bool visible) override; virtual void GroupVisibility(quint32 object, bool visible) override;
public slots: public slots:
virtual void FullUpdateFromFile() override; virtual void FullUpdateFromFile() override;