diff --git a/src/Gui/GuiApplicationNativeEventAware.cpp b/src/Gui/GuiApplicationNativeEventAware.cpp index 8f6d134cd2..b63667a9e8 100644 --- a/src/Gui/GuiApplicationNativeEventAware.cpp +++ b/src/Gui/GuiApplicationNativeEventAware.cpp @@ -60,7 +60,9 @@ Gui::GUIApplicationNativeEventAware::~GUIApplicationNativeEventAware() void Gui::GUIApplicationNativeEventAware::initSpaceball(QMainWindow *window) { #if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND) - nativeEvent->initSpaceball(window); + nativeEvent->initSpaceball(window); +#else + Q_UNUSED(window); #endif Spaceball::MotionEvent::MotionEventType = QEvent::registerEventType(); Spaceball::ButtonEvent::ButtonEventType = QEvent::registerEventType(); diff --git a/src/Mod/Sketcher/App/Constraint.h b/src/Mod/Sketcher/App/Constraint.h index fd1da59f73..cbeda2c22c 100644 --- a/src/Mod/Sketcher/App/Constraint.h +++ b/src/Mod/Sketcher/App/Constraint.h @@ -79,7 +79,7 @@ enum PointPos { none, start, end, mid }; class SketcherExport Constraint : public Base::Persistence { - TYPESYSTEM_HEADER(); + TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: Constraint(); diff --git a/src/Mod/TechDraw/Gui/QGIPrimPath.h b/src/Mod/TechDraw/Gui/QGIPrimPath.h index 0ee6156876..c0ce5c0ed3 100644 --- a/src/Mod/TechDraw/Gui/QGIPrimPath.h +++ b/src/Mod/TechDraw/Gui/QGIPrimPath.h @@ -43,9 +43,9 @@ public: enum {Type = QGraphicsItem::UserType + 170}; - int type() const { return Type;} - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); - virtual QPainterPath shape() const { return path(); } + int type() const override { return Type;} + virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override; + virtual QPainterPath shape() const override { return path(); } void setHighlighted(bool state); virtual void setPrettyNormal(); @@ -58,9 +58,9 @@ public: virtual void setNormalColor(QColor c); protected: - virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event); - virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); - virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); + virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override; + virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override; + virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override; virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override; virtual QColor getNormalColor(void); diff --git a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp index af42415181..7743cf0526 100644 --- a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp @@ -181,20 +181,20 @@ void QGIViewBalloon::onAttachPointPicked(QGIView *view, QPointF pos) QGVPage* page; if (mdi != nullptr) { page = mdi->getQGVPage(); + + QString labelText = QString::fromUtf8(std::to_string(page->balloonIndex).c_str()); + balloon->Text.setValue(std::to_string(page->balloonIndex++).c_str()); + + QFont font = balloonLabel->getFont(); + font.setPointSizeF(Rez::guiX(vp->Fontsize.getValue())); + font.setFamily(QString::fromUtf8(vp->Font.getValue())); + balloonLabel->setFont(font); + prepareGeometryChange(); + + // Default label position + balloonLabel->setPosFromCenter(pos.x() + 200, pos.y() -200); + balloonLabel->setDimString(labelText, Rez::guiX(balloon->TextWrapLen.getValue())); } - - QString labelText = QString::fromUtf8(std::to_string(page->balloonIndex).c_str()); - balloon->Text.setValue(std::to_string(page->balloonIndex++).c_str()); - - QFont font = balloonLabel->getFont(); - font.setPointSizeF(Rez::guiX(vp->Fontsize.getValue())); - font.setFamily(QString::fromUtf8(vp->Font.getValue())); - balloonLabel->setFont(font); - prepareGeometryChange(); - - // Default label position - balloonLabel->setPosFromCenter(pos.x() + 200, pos.y() -200); - balloonLabel->setDimString(labelText, Rez::guiX(balloon->TextWrapLen.getValue())); } draw();