Setter and getter for attribute line color.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-02-04 11:21:09 +02:00
parent 9d9bc2404b
commit 4d6fae5840
2 changed files with 24 additions and 1 deletions

View File

@ -47,7 +47,7 @@ qreal VDrawTool::factor = 1;
*/
VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent)
:VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), nameActivDraw(doc->GetNameActivPP()),
dialog(nullptr), typeLine(TypeLineLine)
dialog(nullptr), typeLine(TypeLineLine), lineColor(ColorBlack)
{
connect(this->doc, &VPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw);
connect(this->doc, &VPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw);
@ -300,3 +300,19 @@ void VDrawTool::SetTypeLine(const QString &value)
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}
//---------------------------------------------------------------------------------------------------------------------
QString VDrawTool::GetLineColor() const
{
return lineColor;
}
//---------------------------------------------------------------------------------------------------------------------
void VDrawTool::SetLineColor(const QString &value)
{
lineColor = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}

View File

@ -58,6 +58,10 @@ public:
QString getLineType() const;
virtual void SetTypeLine(const QString &value);
QString GetLineColor() const;
void SetLineColor(const QString &value);
public slots:
virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable);
virtual void ChangedActivDraw(const QString &newName);
@ -79,6 +83,9 @@ protected:
/** @brief typeLine line type. */
QString typeLine;
/** @brief lineColor color line or curve, but not a point. */
QString lineColor;
void AddToCalculation(const QDomElement &domElement);
/** @brief SaveDialog save options into file after change in dialog. */