From aead9ac8c7a6874cffadd2b4c6a98bd82ab345ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Br=C3=A6strup=20Sayoc?= Date: Sun, 23 Feb 2025 00:05:30 +0100 Subject: [PATCH] TechDraw: remove unneeded state from QGIPrimPath --- src/Mod/TechDraw/Gui/PATPathMaker.cpp | 1 + src/Mod/TechDraw/Gui/QGIArrow.cpp | 3 +- src/Mod/TechDraw/Gui/QGIBreakLine.cpp | 7 +-- src/Mod/TechDraw/Gui/QGICMark.cpp | 6 +- src/Mod/TechDraw/Gui/QGICMark.h | 2 +- src/Mod/TechDraw/Gui/QGICenterLine.cpp | 9 +-- src/Mod/TechDraw/Gui/QGIDimLines.cpp | 3 +- src/Mod/TechDraw/Gui/QGIEdge.cpp | 16 ++--- src/Mod/TechDraw/Gui/QGIEdge.h | 2 - src/Mod/TechDraw/Gui/QGIFace.cpp | 40 ++++++------ src/Mod/TechDraw/Gui/QGIFace.h | 9 +++ src/Mod/TechDraw/Gui/QGIHighlight.cpp | 8 +-- src/Mod/TechDraw/Gui/QGIPrimPath.cpp | 82 ++++++++----------------- src/Mod/TechDraw/Gui/QGIPrimPath.h | 32 ++++------ src/Mod/TechDraw/Gui/QGIViewBalloon.cpp | 4 -- 15 files changed, 79 insertions(+), 145 deletions(-) diff --git a/src/Mod/TechDraw/Gui/PATPathMaker.cpp b/src/Mod/TechDraw/Gui/PATPathMaker.cpp index 8b3d71fe7f..3875cce405 100644 --- a/src/Mod/TechDraw/Gui/PATPathMaker.cpp +++ b/src/Mod/TechDraw/Gui/PATPathMaker.cpp @@ -44,6 +44,7 @@ using namespace TechDraw; PATPathMaker::PATPathMaker(QGraphicsItem* parent, double lineWidth, double fillScale) : m_parent(parent), + m_pen(), m_fillScale(fillScale), m_lineWidth(lineWidth) { diff --git a/src/Mod/TechDraw/Gui/QGIArrow.cpp b/src/Mod/TechDraw/Gui/QGIArrow.cpp index 7929328cba..1c82859f61 100644 --- a/src/Mod/TechDraw/Gui/QGIArrow.cpp +++ b/src/Mod/TechDraw/Gui/QGIArrow.cpp @@ -46,8 +46,7 @@ QGIArrow::QGIArrow() : setFlipped(false); setFillStyle(Qt::SolidPattern); m_brush.setStyle(m_fill); - m_colDefFill = getNormalColor(); - m_colNormalFill = m_colDefFill; + m_colNormalFill = getNormalColor(); setCacheMode(QGraphicsItem::NoCache); setAcceptHoverEvents(false); diff --git a/src/Mod/TechDraw/Gui/QGIBreakLine.cpp b/src/Mod/TechDraw/Gui/QGIBreakLine.cpp index 4a4df4a99e..32a0629029 100644 --- a/src/Mod/TechDraw/Gui/QGIBreakLine.cpp +++ b/src/Mod/TechDraw/Gui/QGIBreakLine.cpp @@ -64,9 +64,7 @@ QGIBreakLine::QGIBreakLine() setColor(PreferencesGui::sectionLineQColor()); - - // setFill(Qt::NoBrush); - setFill(Qt::SolidPattern); + m_brush.setStyle(Qt::SolidPattern); } void QGIBreakLine::draw() @@ -253,9 +251,6 @@ void QGIBreakLine::paint ( QPainter * painter, const QStyleOptionGraphicsItem * void QGIBreakLine::setTools() { - m_pen.setWidthF(m_width); - m_pen.setColor(m_colCurrent); - m_brush.setStyle(m_brushCurrent); m_brush.setColor(PreferencesGui::pageQColor()); m_line0->setPen(m_pen); diff --git a/src/Mod/TechDraw/Gui/QGICMark.cpp b/src/Mod/TechDraw/Gui/QGICMark.cpp index 930119b185..881d4f75c7 100644 --- a/src/Mod/TechDraw/Gui/QGICMark.cpp +++ b/src/Mod/TechDraw/Gui/QGICMark.cpp @@ -42,7 +42,7 @@ using namespace TechDrawGui; QGICMark::QGICMark(int index) : QGIVertex(index) { m_size = 3.0; - m_width = 0.75; + setThick(0.75); draw(); } void QGICMark::draw() @@ -63,7 +63,7 @@ void QGICMark::setSize(float s) void QGICMark::setThick(float t) { - m_width = t; + m_pen.setWidthF(t); draw(); } @@ -73,7 +73,7 @@ QColor QGICMark::getCMarkColor() } void QGICMark::setPrettyNormal() { - m_colCurrent = getCMarkColor(); + m_pen.setColor(getCMarkColor()); update(); } diff --git a/src/Mod/TechDraw/Gui/QGICMark.h b/src/Mod/TechDraw/Gui/QGICMark.h index 4cb3481cef..e254f65c72 100644 --- a/src/Mod/TechDraw/Gui/QGICMark.h +++ b/src/Mod/TechDraw/Gui/QGICMark.h @@ -46,7 +46,7 @@ public: void draw(void); float getSize() { return m_size; } void setSize(float s); - float getThick() { return m_width; } + float getThick() { return m_pen.widthF(); } void setThick(float t); void setPrettyNormal() override; diff --git a/src/Mod/TechDraw/Gui/QGICenterLine.cpp b/src/Mod/TechDraw/Gui/QGICenterLine.cpp index dd52aed552..9da9023e4d 100644 --- a/src/Mod/TechDraw/Gui/QGICenterLine.cpp +++ b/src/Mod/TechDraw/Gui/QGICenterLine.cpp @@ -104,7 +104,7 @@ void QGICenterLine::setIntersection(bool isIntersecting) { void QGICenterLine::setTools() { - if (m_styleCurrent == Qt::DashDotLine) { + if (m_pen.style() == Qt::DashDotLine) { QVector dashes; qreal space = 4; // in unit width qreal dash = 16; @@ -116,7 +116,7 @@ void QGICenterLine::setTools() qreal dashlen = dot + 2 * space + dash; qreal l_len = sqrt(pow(m_start.x() - m_end.x(), 2) + pow(m_start.y() - m_end.y(), 2)) / 2.0; // convert from pixelunits to width units - l_len = l_len / m_width; + l_len = l_len / m_pen.widthF(); // note that the additional length using RoundCap or SquareCap does not // count here! if (m_isintersection) { @@ -127,12 +127,7 @@ void QGICenterLine::setTools() m_pen.setDashPattern(dashes); } - else { - m_pen.setStyle(m_styleCurrent); - } m_pen.setCapStyle(Qt::RoundCap); - m_pen.setWidthF(m_width); - m_pen.setColor(m_colCurrent); m_line->setPen(m_pen); } diff --git a/src/Mod/TechDraw/Gui/QGIDimLines.cpp b/src/Mod/TechDraw/Gui/QGIDimLines.cpp index 8da0c20bc1..d3d8f09e6f 100644 --- a/src/Mod/TechDraw/Gui/QGIDimLines.cpp +++ b/src/Mod/TechDraw/Gui/QGIDimLines.cpp @@ -42,7 +42,8 @@ QGIDimLines::QGIDimLines() setFlag(QGraphicsItem::ItemIsSelectable, false); setFlag(QGraphicsItem::ItemIsMovable, false); - m_width = 0.5; + setFill(QColor(100, 100, 0)); + setWidth(0.5); } void QGIDimLines::draw() diff --git a/src/Mod/TechDraw/Gui/QGIEdge.cpp b/src/Mod/TechDraw/Gui/QGIEdge.cpp index 0f56d793d1..e900685afb 100644 --- a/src/Mod/TechDraw/Gui/QGIEdge.cpp +++ b/src/Mod/TechDraw/Gui/QGIEdge.cpp @@ -51,7 +51,7 @@ QGIEdge::QGIEdge(int index) : setFlag(QGraphicsItem::ItemIsFocusable, true); // to get key press events setFlag(QGraphicsItem::ItemIsSelectable, true); - m_width = 1.0; + setWidth(1.0); setCosmetic(isCosmetic); setFill(Qt::NoBrush); } @@ -70,18 +70,18 @@ void QGIEdge::setCosmetic(bool state) void QGIEdge::setHiddenEdge(bool b) { isHiddenEdge = b; if (b) { - m_styleCurrent = getHiddenStyle(); + m_pen.setStyle(getHiddenStyle()); } else { - m_styleCurrent = Qt::SolidLine; + m_pen.setStyle(Qt::SolidLine); } } void QGIEdge::setPrettyNormal() { // Base::Console().Message("QGIE::setPrettyNormal()\n"); if (isHiddenEdge) { - m_colCurrent = getHiddenColor(); + m_pen.setColor(getHiddenColor()); } else { - m_colCurrent = getNormalColor(); + m_pen.setColor(getNormalColor()); } //should call QGIPP::setPrettyNormal()? } @@ -137,9 +137,3 @@ void QGIEdge::setLinePen(QPen linePen) { m_pen = linePen; } - -void QGIEdge::setCurrentPen() -{ - m_pen.setWidthF(m_width); - m_pen.setColor(m_colCurrent); -} diff --git a/src/Mod/TechDraw/Gui/QGIEdge.h b/src/Mod/TechDraw/Gui/QGIEdge.h index 5e8f92b9b0..2d662a1e26 100644 --- a/src/Mod/TechDraw/Gui/QGIEdge.h +++ b/src/Mod/TechDraw/Gui/QGIEdge.h @@ -59,8 +59,6 @@ public: void setSource(TechDraw::SourceType source) { m_source = source; } TechDraw::SourceType getSource() const { return m_source;} - void setCurrentPen() override; - protected: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override; diff --git a/src/Mod/TechDraw/Gui/QGIFace.cpp b/src/Mod/TechDraw/Gui/QGIFace.cpp index 3331f2f6ff..b55a09da67 100644 --- a/src/Mod/TechDraw/Gui/QGIFace.cpp +++ b/src/Mod/TechDraw/Gui/QGIFace.cpp @@ -66,8 +66,6 @@ QGIFace::QGIFace(int index) : setStyle(Qt::NoPen); //don't draw face lines, just fill for debugging //setStyle(Qt::DashLine); m_geomColor = PreferencesGui::getAccessibleQColor(QColor(Qt::black)); - m_styleCurrent = Qt::NoPen; - m_pen.setStyle(m_styleCurrent); setLineWeight(0.0); //0 = cosmetic m_texture = QPixmap(); //empty texture @@ -79,19 +77,11 @@ QGIFace::QGIFace(int index) : getParameters(); - // set up style & colour defaults - m_colDefFill = Base::Color(static_cast(Preferences::getPreferenceGroup("Colors")->GetUnsigned("FaceColor", COLWHITE))) - .asValue(); - m_colDefFill.setAlpha(Preferences::getPreferenceGroup("Colors")->GetBool("ClearFace", false) ? ALPHALOW : ALPHAHIGH); - - m_fillDef = Qt::SolidPattern; - m_fillSelect = Qt::SolidPattern; - setFillMode(FillMode::NoFill); - if (m_colDefFill.alpha() > 0) { + if (getDefaultFillColor().alpha() > 0) { setFillMode(FillMode::PlainFill); } - setFill(m_colDefFill, m_fillDef); + setFill(getDefaultFillColor(), getDefaultFillStyle()); m_sharedRender = new QSvgRenderer(); m_patMaker = new PATPathMaker(this, 1.0, 1.0); @@ -103,6 +93,14 @@ QGIFace::~QGIFace() delete m_patMaker; } +QColor QGIFace::getDefaultFillColor() +{ + QColor color = Base::Color(static_cast(Preferences::getPreferenceGroup("Colors")->GetUnsigned("FaceColor", COLWHITE))) + .asValue(); + color.setAlpha(Preferences::getPreferenceGroup("Colors")->GetBool("ClearFace", false) ? ALPHALOW : ALPHAHIGH); + return color; +} + /// redraw this face void QGIFace::draw() { @@ -118,16 +116,16 @@ void QGIFace::draw() setFlag(QGraphicsItem::ItemClipsChildrenToShape, false); if (!m_lineSets.empty()) { m_brush.setTexture(QPixmap()); - m_fillStyleCurrent = m_fillDef; - m_fillNormal = m_fillStyleCurrent; + m_fillNormal = getDefaultFillStyle(); + m_brush.setStyle(m_fillNormal); for (auto& ls: m_lineSets) { lineSetToFillItems(ls); } } } else if (m_mode == FillMode::SvgFill) { m_brush.setTexture(QPixmap()); - m_fillNormal = m_fillDef; - m_fillStyleCurrent = m_fillNormal; + m_fillNormal = getDefaultFillStyle(); + m_brush.setStyle(m_fillNormal); setFlag(QGraphicsItem::ItemClipsChildrenToShape,true); loadSvgHatch(m_fileSpec); if (exporting()) { @@ -138,7 +136,7 @@ void QGIFace::draw() m_svgHatchArea->show(); } } else if (m_mode == FillMode::BitmapFill) { - m_fillStyleCurrent = Qt::TexturePattern; + m_brush.setStyle(Qt::TexturePattern); m_texture = textureFromBitmap(m_fileSpec); m_brush.setTexture(m_texture); } else if (m_mode == FillMode::PlainFill) { @@ -154,7 +152,7 @@ void QGIFace::setPrettyNormal() { // Base::Console().Message("QGIF::setPrettyNormal() - hatched: %d\n", isHatched()); if (isHatched() && (m_mode == FillMode::BitmapFill) ) { //hatch with bitmap fill - m_fillStyleCurrent = Qt::TexturePattern; + m_brush.setStyle(Qt::TexturePattern); m_brush.setTexture(m_texture); } else { m_brush.setTexture(QPixmap()); @@ -165,16 +163,14 @@ void QGIFace::setPrettyNormal() { /// show the face style & colour in pre-select configuration void QGIFace::setPrettyPre() { // Base::Console().Message("QGIF::setPrettyPre()\n"); - m_fillStyleCurrent = Qt::SolidPattern; - m_brush.setTexture(QPixmap()); + m_brush.setStyle(Qt::SolidPattern); QGIPrimPath::setPrettyPre(); } /// show the face style & colour in selected configuration void QGIFace::setPrettySel() { // Base::Console().Message("QGIF::setPrettySel()\n"); - m_fillStyleCurrent = Qt::SolidPattern; - m_brush.setTexture(QPixmap()); + m_brush.setStyle(Qt::SolidPattern); QGIPrimPath::setPrettySel(); } diff --git a/src/Mod/TechDraw/Gui/QGIFace.h b/src/Mod/TechDraw/Gui/QGIFace.h index 95fb9e3201..e06adc270c 100644 --- a/src/Mod/TechDraw/Gui/QGIFace.h +++ b/src/Mod/TechDraw/Gui/QGIFace.h @@ -82,6 +82,11 @@ public: void setDrawEdges(bool state); virtual void setOutline(const QPainterPath& path); + QColor getDefaultFillColor() override; + Qt::BrushStyle getDefaultFillStyle() override { + return Qt::SolidPattern; + } + //shared fill parms void isHatched(bool state) {m_isHatched = state; } bool isHatched() {return m_isHatched;} @@ -123,6 +128,10 @@ public: void setHatchOffset(Base::Vector3d offset) { m_hatchOffset = offset; } Base::Vector3d getHatchOffset() { return m_hatchOffset; } + void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override { + QGIPrimPath::paint(painter, option, widget); + } + protected: void makeMark(double x, double y); // NOLINT readability-identifier-length double getXForm(); diff --git a/src/Mod/TechDraw/Gui/QGIHighlight.cpp b/src/Mod/TechDraw/Gui/QGIHighlight.cpp index 5d41c613d8..165a9156e6 100644 --- a/src/Mod/TechDraw/Gui/QGIHighlight.cpp +++ b/src/Mod/TechDraw/Gui/QGIHighlight.cpp @@ -188,16 +188,10 @@ void QGIHighlight::paint ( QPainter * painter, const QStyleOptionGraphicsItem * void QGIHighlight::setTools() { - m_pen.setWidthF(m_width); - m_pen.setColor(m_colCurrent); - - m_brush.setStyle(m_brushCurrent); - m_brush.setColor(m_colCurrent); - m_circle->setPen(m_pen); m_rect->setPen(m_pen); - m_reference->setDefaultTextColor(m_colCurrent); + m_reference->setDefaultTextColor(m_pen.color()); } void QGIHighlight::setLinePen(QPen isoPen) diff --git a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp index 44aa86a0f5..6bee0cf657 100644 --- a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp +++ b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp @@ -47,10 +47,7 @@ using namespace TechDraw; using DGU = DrawGuiUtil; QGIPrimPath::QGIPrimPath(): - m_width(0), - m_capStyle(Qt::RoundCap), - m_fillStyleCurrent (Qt::NoBrush), - m_fillOverride(false) + m_brush(Qt::NoBrush) { setCacheMode(QGraphicsItem::NoCache); setFlag(QGraphicsItem::ItemIsSelectable, true); @@ -61,26 +58,19 @@ QGIPrimPath::QGIPrimPath(): setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); setAcceptHoverEvents(true); - isHighlighted = false; multiselectActivated = false; - m_colOverride = false; m_colNormal = getNormalColor(); - m_colCurrent = m_colNormal; + m_pen.setColor(m_colNormal); m_styleNormal = Qt::SolidLine; - m_styleCurrent = m_styleNormal; - m_pen.setStyle(m_styleCurrent); - m_capStyle = prefCapStyle(); - m_pen.setCapStyle(m_capStyle); - m_pen.setWidthF(m_width); + m_pen.setStyle(m_styleNormal); + m_pen.setCapStyle(prefCapStyle()); + m_pen.setWidthF(0); - m_fillDef = Qt::NoBrush; - m_fillSelect = Qt::SolidPattern; - m_fillNormal = m_fillDef; - m_fillStyleCurrent = m_fillNormal; + m_fillNormal = getDefaultFillStyle(); + m_brush.setStyle(m_fillNormal); - m_colDefFill = Qt::white; - setFillColor(m_colDefFill); + setFillColor(getDefaultFillColor()); setPrettyNormal(); } @@ -119,22 +109,18 @@ void QGIPrimPath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void QGIPrimPath::setPrettyNormal() { - m_colCurrent = m_colNormal; - m_fillColorCurrent = m_colNormalFill; + m_pen.setColor(m_colNormal); + m_brush.setColor(m_colNormalFill); } void QGIPrimPath::setPrettyPre() { - m_colCurrent = getPreColor(); - if (!m_fillOverride) { - m_fillColorCurrent = getPreColor(); - } + m_pen.setColor(getPreColor()); + m_brush.setColor(getPreColor()); } void QGIPrimPath::setPrettySel() { - m_colCurrent = getSelectColor(); - if (!m_fillOverride) { - m_fillColorCurrent = getSelectColor(); - } + m_pen.setColor(getSelectColor()); + m_brush.setColor(getSelectColor()); } //wf: why would a face use its parent's normal colour? @@ -142,11 +128,6 @@ void QGIPrimPath::setPrettySel() { QColor QGIPrimPath::getNormalColor() { QGIView *parent; - - if (m_colOverride) { - return m_colNormal; - } - QGraphicsItem* qparent = parentItem(); if (!qparent) { parent = nullptr; @@ -195,8 +176,7 @@ QColor QGIPrimPath::getSelectColor() void QGIPrimPath::setWidth(double w) { // Base::Console().Message("QGIPP::setWidth(%.3f)\n", w); - m_width = w; - m_pen.setWidthF(m_width); + m_pen.setWidthF(w); } void QGIPrimPath::setStyle(Qt::PenStyle s) @@ -204,27 +184,25 @@ void QGIPrimPath::setStyle(Qt::PenStyle s) // TODO: edge lines for faces are drawn with setStyle(Qt::NoPen) and trigger this message. // Base::Console().Warning("QGIPP::setStyle(Qt: %d) is deprecated. Use setLinePen instead\n", s); m_styleNormal = s; - m_styleCurrent = s; + m_pen.setStyle(s); } void QGIPrimPath::setStyle(int s) { // TODO: edge lines for faces are drawn with setStyle(Qt::NoPen) and trigger this message. // Base::Console().Warning("QGIPP::setStyle(int: %d) is deprecated. Use setLinePen instead\n", s); - m_styleCurrent = static_cast(s); m_styleNormal = static_cast(s); + m_pen.setStyle(m_styleNormal); } void QGIPrimPath::setNormalColor(QColor c) { m_colNormal = c; - m_colOverride = true; - m_colCurrent = m_colNormal; + m_pen.setColor(m_colNormal); } void QGIPrimPath::setCapStyle(Qt::PenCapStyle c) { - m_capStyle = c; m_pen.setCapStyle(c); } @@ -286,44 +264,32 @@ void QGIPrimPath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void QGIPrimPath::setFill(QColor c, Qt::BrushStyle s) { setFillColor(c); m_fillNormal = s; - m_fillStyleCurrent = s; + m_brush.setStyle(s); } void QGIPrimPath::setFill(QBrush b) { - setFillColor(b.color()); m_fillNormal = b.style(); - m_fillStyleCurrent = b.style(); + setFillColor(b.color()); + m_brush.setStyle(b.style()); } void QGIPrimPath::resetFill() { - m_colNormalFill = m_colDefFill; - m_fillNormal = m_fillDef; - m_fillStyleCurrent = m_fillDef; + m_colNormalFill = getDefaultFillColor(); + m_fillNormal = getDefaultFillStyle(); + m_brush.setStyle(m_fillNormal); } //set PlainFill void QGIPrimPath::setFillColor(QColor c) { m_colNormalFill = c; - m_fillColorCurrent = m_colNormalFill; -} - -void QGIPrimPath::setCurrentPen() -{ - m_pen.setWidthF(m_width); - m_pen.setColor(m_colCurrent); - m_pen.setStyle(m_styleCurrent); } void QGIPrimPath::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) { QStyleOptionGraphicsItem myOption(*option); myOption.state &= ~QStyle::State_Selected; - setCurrentPen(); setPen(m_pen); - - m_brush.setColor(m_fillColorCurrent); - m_brush.setStyle(m_fillStyleCurrent); setBrush(m_brush); QGraphicsPathItem::paint (painter, &myOption, widget); diff --git a/src/Mod/TechDraw/Gui/QGIPrimPath.h b/src/Mod/TechDraw/Gui/QGIPrimPath.h index 4251bbb8ef..d73b07d266 100644 --- a/src/Mod/TechDraw/Gui/QGIPrimPath.h +++ b/src/Mod/TechDraw/Gui/QGIPrimPath.h @@ -55,25 +55,22 @@ public: virtual void setPrettyPre(); virtual void setPrettySel(); virtual void setWidth(double w); - virtual double getWidth() { return m_width;} - Qt::PenStyle getStyle() { return m_styleCurrent; } + virtual double getWidth() { return m_pen.widthF();} + Qt::PenStyle getStyle() { return m_pen.style(); } void setStyle(Qt::PenStyle s); void setStyle(int s); virtual void setNormalColor(QColor c); virtual void setCapStyle(Qt::PenCapStyle c); //plain color fill parms - void setFillStyle(Qt::BrushStyle f) { m_fillStyleCurrent = f; } - Qt::BrushStyle getFillStyle() { return m_fillStyleCurrent; } + void setFillStyle(Qt::BrushStyle f) { m_brush.setStyle(f); } + Qt::BrushStyle getFillStyle() { return m_brush.style(); } void setFill(QColor c, Qt::BrushStyle s); void setFill(QBrush b); void resetFill(); void setFillColor(QColor c); - QColor getFillColor() { return m_colDefFill; } - void setFillOverride(bool b) { m_fillOverride = b; } - - virtual void setCurrentPen(); + QColor getFillColor() { return getDefaultFillColor(); } protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override; @@ -88,32 +85,25 @@ protected: virtual QColor getNormalColor(); virtual QColor getPreColor(); virtual QColor getSelectColor(); + virtual QColor getDefaultFillColor() { + return Qt::white; + } + virtual Qt::BrushStyle getDefaultFillStyle() { + return Qt::NoBrush; + } Base::Reference getParmGroup(); virtual Qt::PenCapStyle prefCapStyle(); - bool isHighlighted; bool multiselectActivated; QPen m_pen; - QColor m_colCurrent; QColor m_colNormal; - bool m_colOverride; - Qt::PenStyle m_styleCurrent; Qt::PenStyle m_styleNormal; - double m_width; - Qt::PenCapStyle m_capStyle; QBrush m_brush; - Qt::BrushStyle m_fillStyleCurrent; //current fill style - QColor m_fillColorCurrent; //current fill color - QColor m_colDefFill; //"no color" default normal fill color QColor m_colNormalFill; //current Normal fill color def or plain fill - Qt::BrushStyle m_fillDef; //default Normal fill style Qt::BrushStyle m_fillNormal; //current Normal fill style - Qt::BrushStyle m_fillSelect; //Select/preSelect fill style - - bool m_fillOverride; private: diff --git a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp index bd8a9d3898..c63e7c5cdc 100644 --- a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp @@ -267,7 +267,6 @@ QGIViewBalloon::QGIViewBalloon() addToGroup(balloonShape); balloonShape->setNormalColor(prefNormalColor()); balloonShape->setFill(Qt::transparent, Qt::SolidPattern); - balloonShape->setFillOverride(true); balloonShape->setPrettyNormal(); arrow = new QGIArrow(); @@ -863,9 +862,6 @@ void QGIViewBalloon::drawBalloon(bool originDrag) void QGIViewBalloon::setPrettyPre(void) { arrow->setPrettyPre(); - //TODO: primPath needs override for fill - //balloonShape->setFillOverride(true); //don't fill with pre or select colours. - // balloonShape->setFill(Qt::white, Qt::NoBrush); balloonShape->setPrettyPre(); balloonLines->setPrettyPre(); }