pulseview/0004-Fix-737-by-adding-the-...

165 lines
5.1 KiB
Diff

From b2650e6978b19c44a6fc375931bc412ad4eefa5b Mon Sep 17 00:00:00 2001
From: Soeren Apel <soeren@apelpie.net>
Date: Sun, 31 Jan 2016 18:18:47 +0100
Subject: [PATCH 04/13] Fix #737 by adding the override specifier where needed
---
pv/view/cursorpair.hpp | 14 +++++++-------
pv/view/ruler.hpp | 12 ++++++------
pv/view/timemarker.hpp | 14 +++++++-------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/pv/view/cursorpair.hpp b/pv/view/cursorpair.hpp
index 345700f..7cbd4f0 100644
--- a/pv/view/cursorpair.hpp
+++ b/pv/view/cursorpair.hpp
@@ -49,7 +49,7 @@ public:
/**
* Returns true if the item is visible and enabled.
*/
- bool enabled() const;
+ bool enabled() const override;
/**
* Returns a pointer to the first cursor.
@@ -66,14 +66,14 @@ public:
*/
void set_time(const pv::util::Timestamp& time) override;
- float get_x() const;
+ float get_x() const override;
- QPoint point(const QRect &rect) const;
+ QPoint point(const QRect &rect) const override;
- pv::widgets::Popup* create_popup(QWidget *parent);
+ pv::widgets::Popup* create_popup(QWidget *parent) override;
public:
- QRectF label_rect(const QRectF &rect) const;
+ QRectF label_rect(const QRectF &rect) const override;
/**
* Paints the marker's label to the ruler.
@@ -81,14 +81,14 @@ public:
* @param rect The rectangle of the ruler client area.
* @param hover true if the label is being hovered over by the mouse.
*/
- void paint_label(QPainter &p, const QRect &rect, bool hover);
+ void paint_label(QPainter &p, const QRect &rect, bool hover) override;
/**
* Paints the background layer of the item with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
*/
- void paint_back(QPainter &p, const ViewItemPaintParams &pp);
+ void paint_back(QPainter &p, const ViewItemPaintParams &pp) override;
/**
* Constructs the string to display.
diff --git a/pv/view/ruler.hpp b/pv/view/ruler.hpp
index 90556a0..aabbe48 100644
--- a/pv/view/ruler.hpp
+++ b/pv/view/ruler.hpp
@@ -63,14 +63,14 @@ public:
Ruler(View &parent);
public:
- QSize sizeHint() const;
+ QSize sizeHint() const override;
/**
* The extended area that the header widget would like to be sized to.
* @remarks This area is the area specified by sizeHint, extended by
* the area to overlap the viewport.
*/
- QSize extended_size_hint() const;
+ QSize extended_size_hint() const override;
/**
* Formats a timestamp depending on its distance to another timestamp.
@@ -109,7 +109,7 @@ private:
/**
* Gets the time items.
*/
- std::vector< std::shared_ptr<pv::view::ViewItem> > items();
+ std::vector< std::shared_ptr<pv::view::ViewItem> > items() override;
/**
* Gets the first view item which has a label that contains @c pt .
@@ -118,11 +118,11 @@ private:
* @c shared_ptr if no item was found.
*/
std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
- const QPoint &pt);
+ const QPoint &pt) override;
- void paintEvent(QPaintEvent *event);
+ void paintEvent(QPaintEvent *event) override;
- void mouseDoubleClickEvent(QMouseEvent *e);
+ void mouseDoubleClickEvent(QMouseEvent *e) override;
/**
* Draw a hover arrow under the cursor position.
diff --git a/pv/view/timemarker.hpp b/pv/view/timemarker.hpp
index f16fea0..c65dab7 100644
--- a/pv/view/timemarker.hpp
+++ b/pv/view/timemarker.hpp
@@ -68,27 +68,27 @@ public:
*/
void set_time(const pv::util::Timestamp& time) override;
- float get_x() const;
+ float get_x() const override;
/**
* Gets the arrow-tip point of the time marker.
* @param rect the rectangle of the ruler area.
*/
- QPoint point(const QRect &rect) const;
+ QPoint point(const QRect &rect) const override;
/**
* Computes the outline rectangle of a label.
* @param rect the rectangle of the header area.
* @return Returns the rectangle of the signal label.
*/
- QRectF label_rect(const QRectF &rect) const;
+ QRectF label_rect(const QRectF &rect) const override;
/**
* Computes the outline rectangle of the viewport hit-box.
* @param rect the rectangle of the viewport area.
* @return Returns the rectangle of the hit-box.
*/
- QRectF hit_box_rect(const ViewItemPaintParams &pp) const;
+ QRectF hit_box_rect(const ViewItemPaintParams &pp) const override;
/**
* Gets the text to show in the marker.
@@ -101,16 +101,16 @@ public:
* @param rect The rectangle of the ruler client area.
* @param hover true if the label is being hovered over by the mouse.
*/
- void paint_label(QPainter &p, const QRect &rect, bool hover);
+ void paint_label(QPainter &p, const QRect &rect, bool hover) override;
/**
* Paints the foreground layer of the item with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
*/
- void paint_fore(QPainter &p, const ViewItemPaintParams &pp);
+ void paint_fore(QPainter &p, const ViewItemPaintParams &pp) override;
- virtual pv::widgets::Popup* create_popup(QWidget *parent);
+ virtual pv::widgets::Popup* create_popup(QWidget *parent) override;
private Q_SLOTS:
void on_value_changed(const pv::util::Timestamp& value);
--
2.4.3