TechDraw: Clean up warnings about missing override

This commit is contained in:
Ian Rees 2016-08-16 08:13:55 +12:00
parent b432a0333c
commit d9b4213989
2 changed files with 18 additions and 15 deletions

View File

@ -44,9 +44,11 @@ public:
~QGCustomSvg(); ~QGCustomSvg();
enum {Type = QGraphicsItem::UserType + 131}; enum {Type = QGraphicsItem::UserType + 131};
int type() const { return Type;} int type() const override { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); virtual void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget = nullptr ) override;
virtual void centerAt(QPointF centerPos); virtual void centerAt(QPointF centerPos);
virtual void centerAt(double cX, double cY); virtual void centerAt(double cX, double cY);
virtual bool load(QByteArray *svgString); virtual bool load(QByteArray *svgString);
@ -54,11 +56,8 @@ public:
protected: protected:
QSvgRenderer *m_svgRender; QSvgRenderer *m_svgRender;
private:
}; };
} // namespace MDIViewPageGui } // namespace TechDrawGui
#endif // DRAWINGGUI_QGCUSTOMSVG_H #endif // DRAWINGGUI_QGCUSTOMSVG_H

View File

@ -50,7 +50,7 @@ public:
virtual ~QGIView() = default; virtual ~QGIView() = default;
enum {Type = QGraphicsItem::UserType + 101}; enum {Type = QGraphicsItem::UserType + 101};
int type() const { return Type;} int type() const override { return Type;}
const char * getViewName() const; const char * getViewName() const;
void setViewFeature(TechDraw::DrawView *obj); void setViewFeature(TechDraw::DrawView *obj);
@ -62,33 +62,37 @@ public:
virtual bool isVisible(void) {return m_visibility;}; virtual bool isVisible(void) {return m_visibility;};
virtual void draw(void); virtual void draw(void);
/// Methods to ensure that Y-Coordinates are orientated correctly. /** Methods to ensure that Y-Coordinates are orientated correctly.
* @{ */
void setPosition(qreal x, qreal y); void setPosition(qreal x, qreal y);
inline qreal getY() { return y() * -1; } inline qreal getY() { return y() * -1; }
bool isInnerView() { return m_innerView; } bool isInnerView() { return m_innerView; }
void isInnerView(bool state) { m_innerView = state; } void isInnerView(bool state) { m_innerView = state; }
double getYInClip(double y); double getYInClip(double y);
/** @} */
void alignTo(QGraphicsItem*, const QString &alignment); void alignTo(QGraphicsItem*, const QString &alignment);
void setLocked(bool state = true) { locked = true; } void setLocked(bool state = true) { locked = true; }
virtual void toggleCache(bool state); virtual void toggleCache(bool state);
virtual void updateView(bool update = false); virtual void updateView(bool update = false);
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); virtual void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget = nullptr ) override;
virtual QRectF boundingRect() const override; virtual QRectF boundingRect() const override;
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event); virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
protected: protected:
QGIView* getQGIVByName(std::string name); QGIView* getQGIVByName(std::string name);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
// Mouse handling // Mouse handling
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event ); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
// Preselection events: // Preselection events:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event); virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
virtual QRectF customChildrenBoundingRect(void); virtual QRectF customChildrenBoundingRect(void);
void dumpRect(char* text, QRectF r); void dumpRect(char* text, QRectF r);