From 66fc63c04bbc1a5a782a68a0bdc9e5b40628f4ae Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 13 Nov 2020 15:27:06 +0200 Subject: [PATCH] Fix crash when save notes for the line tool. --- src/libs/vtools/tools/drawTools/vdrawtool.h | 4 ++-- src/libs/vtools/tools/drawTools/vtoolline.cpp | 13 +++++++++++-- src/libs/vtools/tools/drawTools/vtoolline.h | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index 62ae7bb15..b64576135 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -79,8 +79,8 @@ public: virtual bool IsLabelVisible(quint32 id) const; - QString GetNotes() const; - void SetNotes(const QString ¬es); + QString GetNotes() const; + virtual void SetNotes(const QString ¬es); signals: void ChangedToolSelection(bool selected, quint32 object, quint32 tool); diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index 78aa29b2a..c562b3e5d 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -484,7 +484,7 @@ void VToolLine::SetLineType(const QString &value) { m_lineType = value; - QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. + QSharedPointer obj;//We don't have object for line in data container. Just will send an empty object. SaveOption(obj); } @@ -499,7 +499,16 @@ void VToolLine::SetLineColor(const QString &value) { lineColor = value; - QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. + QSharedPointer obj;//We don't have object for line in data container. Just will send an empty object. + SaveOption(obj); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolLine::SetNotes(const QString ¬es) +{ + m_notes = notes; + + QSharedPointer obj;//We don't have object for line in data container. Just will send an empty object. SaveOption(obj); } diff --git a/src/libs/vtools/tools/drawTools/vtoolline.h b/src/libs/vtools/tools/drawTools/vtoolline.h index 92b1540f4..55f190018 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.h +++ b/src/libs/vtools/tools/drawTools/vtoolline.h @@ -85,6 +85,8 @@ public: QString GetLineColor() const; void SetLineColor(const QString &value); + virtual void SetNotes(const QString ¬es) override; + virtual void ShowVisualization(bool show) override; virtual void SetLineType(const QString &value) override;