diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp index 87d5d7bab..fdc8d6c4b 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp @@ -46,19 +46,6 @@ VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint3 VAbstractSpline::~VAbstractSpline() {} -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - /* From question on StackOverflow - * https://stackoverflow.com/questions/10985028/how-to-remove-border-around-qgraphicsitem-when-selected - * - * There's no interface to disable the drawing of the selection border for the build-in QGraphicsItems. The only way - * I can think of is derive your own items from the build-in ones and override the paint() function:*/ - QStyleOptionGraphicsItem myOption(*option); - myOption.state &= ~QStyle::State_Selected; - QGraphicsPathItem::paint(painter, &myOption, widget); -} - //--------------------------------------------------------------------------------------------------------------------- QString VAbstractSpline::getTagName() const { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h index 5a7d2a10b..140276363 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h @@ -44,8 +44,6 @@ public: virtual ~VAbstractSpline() Q_DECL_OVERRIDE; // cppcheck-suppress duplInheritedMember static const QString TagName; - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, - QWidget * widget = 0) Q_DECL_OVERRIDE; virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::AbstractSpline)}; virtual QString getTagName() const Q_DECL_OVERRIDE; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp index 52f436276..000991f4e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp @@ -60,19 +60,6 @@ VToolDoublePoint::VToolDoublePoint(VAbstractPattern *doc, VContainer *data, quin VToolDoublePoint::~VToolDoublePoint() {} -//--------------------------------------------------------------------------------------------------------------------- -void VToolDoublePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - /* From question on StackOverflow - * https://stackoverflow.com/questions/10985028/how-to-remove-border-around-qgraphicsitem-when-selected - * - * There's no interface to disable the drawing of the selection border for the build-in QGraphicsItems. The only way - * I can think of is derive your own items from the build-in ones and override the paint() function:*/ - QStyleOptionGraphicsItem myOption(*option); - myOption.state &= ~QStyle::State_Selected; - QGraphicsPathItem::paint(painter, &myOption, widget); -} - //--------------------------------------------------------------------------------------------------------------------- QString VToolDoublePoint::nameP1() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h index 9a278a264..0062b954c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h @@ -48,9 +48,6 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::DoublePoint)}; - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, - QWidget * widget = 0) Q_DECL_OVERRIDE; - QString nameP1() const; void setNameP1(const QString &name); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 9f67fd187..2794bd0dc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -77,19 +77,6 @@ VToolSinglePoint::VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quin VToolSinglePoint::~VToolSinglePoint() {} -//--------------------------------------------------------------------------------------------------------------------- -void VToolSinglePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - /* From question on StackOverflow - * https://stackoverflow.com/questions/10985028/how-to-remove-border-around-qgraphicsitem-when-selected - * - * There's no interface to disable the drawing of the selection border for the build-in QGraphicsItems. The only way - * I can think of is derive your own items from the build-in ones and override the paint() function:*/ - QStyleOptionGraphicsItem myOption(*option); - myOption.state &= ~QStyle::State_Selected; - QGraphicsEllipseItem::paint(painter, &myOption, widget); -} - //--------------------------------------------------------------------------------------------------------------------- QString VToolSinglePoint::name() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h index 6c9cf979c..785ed98f9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h @@ -48,8 +48,6 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::SinglePoint)}; - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, - QWidget * widget = 0) Q_DECL_OVERRIDE; QString name() const; void setName(const QString &name); diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index 07225e1d4..5cd75cea1 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -165,19 +165,6 @@ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, con return nullptr; } -//--------------------------------------------------------------------------------------------------------------------- -void VToolLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - /* From question on StackOverflow - * https://stackoverflow.com/questions/10985028/how-to-remove-border-around-qgraphicsitem-when-selected - * - * There's no interface to disable the drawing of the selection border for the build-in QGraphicsItems. The only way - * I can think of is derive your own items from the build-in ones and override the paint() function:*/ - QStyleOptionGraphicsItem myOption(*option); - myOption.state &= ~QStyle::State_Selected; - QGraphicsLineItem::paint(painter, &myOption, widget); -} - //--------------------------------------------------------------------------------------------------------------------- QString VToolLine::getTagName() const { diff --git a/src/libs/vtools/tools/drawTools/vtoolline.h b/src/libs/vtools/tools/drawTools/vtoolline.h index db03b01a8..084c92d80 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.h +++ b/src/libs/vtools/tools/drawTools/vtoolline.h @@ -49,8 +49,7 @@ public: VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString TagName; - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, - QWidget * widget = 0) Q_DECL_OVERRIDE; + virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Line)}; virtual QString getTagName() const Q_DECL_OVERRIDE; diff --git a/src/libs/vwidgets/vcontrolpointspline.cpp b/src/libs/vwidgets/vcontrolpointspline.cpp index 92fd3c931..79e35ac61 100644 --- a/src/libs/vwidgets/vcontrolpointspline.cpp +++ b/src/libs/vwidgets/vcontrolpointspline.cpp @@ -89,19 +89,6 @@ VControlPointSpline::~VControlPointSpline() RestoreOverrideCursor(cursorArrowOpenHand); } -//--------------------------------------------------------------------------------------------------------------------- -void VControlPointSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - /* From question on StackOverflow - * https://stackoverflow.com/questions/10985028/how-to-remove-border-around-qgraphicsitem-when-selected - * - * There's no interface to disable the drawing of the selection border for the build-in QGraphicsItems. The only way - * I can think of is derive your own items from the build-in ones and override the paint() function:*/ - QStyleOptionGraphicsItem myOption(*option); - myOption.state &= ~QStyle::State_Selected; - QGraphicsEllipseItem::paint(painter, &myOption, widget); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief hoverEnterEvent handle hover enter events. diff --git a/src/libs/vwidgets/vcontrolpointspline.h b/src/libs/vwidgets/vcontrolpointspline.h index cd1cfd87d..292ae3209 100644 --- a/src/libs/vwidgets/vcontrolpointspline.h +++ b/src/libs/vwidgets/vcontrolpointspline.h @@ -47,8 +47,7 @@ public: const QPointF &splinePoint, Unit patternUnit, bool freeAngle, bool freeLength, QGraphicsItem * parent = nullptr); virtual ~VControlPointSpline() Q_DECL_OVERRIDE; - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, - QWidget * widget = 0) Q_DECL_OVERRIDE; + virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Vis::ControlPointSpline)}; signals: diff --git a/src/libs/vwidgets/vsimplepoint.cpp b/src/libs/vwidgets/vsimplepoint.cpp index 9974bde2b..87624351f 100644 --- a/src/libs/vwidgets/vsimplepoint.cpp +++ b/src/libs/vwidgets/vsimplepoint.cpp @@ -65,19 +65,6 @@ void VSimplePoint::ChangedActivDraw(const bool &flag) SetPen(this, currentColor, WidthHairLine(patternUnit)); } -//--------------------------------------------------------------------------------------------------------------------- -void VSimplePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - /* From question on StackOverflow - * https://stackoverflow.com/questions/10985028/how-to-remove-border-around-qgraphicsitem-when-selected - * - * There's no interface to disable the drawing of the selection border for the build-in QGraphicsItems. The only way - * I can think of is derive your own items from the build-in ones and override the paint() function:*/ - QStyleOptionGraphicsItem myOption(*option); - myOption.state &= ~QStyle::State_Selected; - QGraphicsEllipseItem::paint(painter, &myOption, widget); -} - //--------------------------------------------------------------------------------------------------------------------- void VSimplePoint::RefreshLine() { diff --git a/src/libs/vwidgets/vsimplepoint.h b/src/libs/vwidgets/vsimplepoint.h index 9d109ebbc..cba340a0b 100644 --- a/src/libs/vwidgets/vsimplepoint.h +++ b/src/libs/vwidgets/vsimplepoint.h @@ -45,8 +45,6 @@ public: virtual ~VSimplePoint() Q_DECL_OVERRIDE; virtual void ChangedActivDraw(const bool &flag) Q_DECL_OVERRIDE; - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, - QWidget * widget = 0) Q_DECL_OVERRIDE; virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Vis::SimplePoint)};