Commit 23a21c69 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECLARE_OVERRIDE

parent e6a295d9
......@@ -108,42 +108,42 @@ namespace Kwave
virtual ~MainWidget();
/** Returns the current zoom factor [samples/pixel] */
virtual double zoom() const;
double zoom() const Q_DECL_OVERRIDE;
/** Returns the width of the current view in pixels */
virtual int visibleWidth() const;
int visibleWidth() const Q_DECL_OVERRIDE;
/** Returns the width of the current view in samples */
virtual sample_index_t visibleSamples() const;
sample_index_t visibleSamples() const Q_DECL_OVERRIDE;
/** Returns the current start position of the visible area [samples] */
virtual sample_index_t visibleOffset() { return m_offset; }
/** Returns the preferred size of the widget */
virtual QSize sizeHint () const { return m_preferred_size; }
QSize sizeHint () const Q_DECL_OVERRIDE { return m_preferred_size; }
protected:
/** @see Qt XDND documentation */
virtual void dragEnterEvent(QDragEnterEvent *event);
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
/**
* For dropping data into an empty signal
* @see Qt XDND documentation
*/
virtual void dropEvent(QDropEvent *event);
void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
/**
* Called if the main widget has been resized and resizes/moves
* the signal widget and the channel controls
*/
virtual void resizeEvent(QResizeEvent *event);
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
/** slot for mouse wheel events, for scrolling/zooming */
virtual void wheelEvent(QWheelEvent *event);
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
/** @see QWidget::closeEvent() */
virtual void closeEvent(QCloseEvent *e);
void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE;
protected slots:
......@@ -159,7 +159,7 @@ namespace Kwave
* @retval -ENOSYS is returned if the command is unknown in this
* component
*/
virtual int executeCommand(const QString &command);
int executeCommand(const QString &command) Q_DECL_OVERRIDE;
/**
* Sets the display offset [samples] and refreshes the screen.
......@@ -172,7 +172,7 @@ namespace Kwave
* Scrolls the display so that the given position gets visible,
* centered within the display if possible.
*/
virtual void scrollTo(sample_index_t pos);
void scrollTo(sample_index_t pos) Q_DECL_OVERRIDE;
/**
* sets a new zoom factor [samples/pixel], does not refresh the screen
......@@ -180,7 +180,7 @@ namespace Kwave
* to [length/width...1/width] (from full display to
* one visible sample only)
*/
void setZoom(double new_zoom);
void setZoom(double new_zoom) Q_DECL_OVERRIDE;
/**
* Zooms into the selected range between the left and right marker.
......
......@@ -50,10 +50,10 @@ namespace Kwave
static void showMessage(const QString &message);
/** handles the painting of this splash screen */
virtual void paintEvent(QPaintEvent *e);
void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
/** hides the splash screen on mouse click */
virtual void mousePressEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
/** should be called when the splashscreen is no longer needed */
void done();
......
......@@ -153,16 +153,16 @@ namespace Kwave
protected slots:
/** @see QWidget::closeEvent() */
virtual void closeEvent(QCloseEvent *e);
void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE;
/** @see Qt XDND documentation */
virtual void dragEnterEvent(QDragEnterEvent *event);
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
/**
* For dropping data into an empty signal
* @see Qt XDND documentation
*/
virtual void dropEvent(QDropEvent *event);
void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
private slots:
......
......@@ -114,10 +114,10 @@ namespace Kwave
protected slots:
void mousePressEvent(QMouseEvent * );
void mouseReleaseEvent(QMouseEvent * );
void mouseMoveEvent(QMouseEvent * );
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent * ) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent * ) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent * ) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
protected:
......
......@@ -128,7 +128,7 @@ namespace Kwave
protected slots:
/** overwritten to call accept() of the KFileWidget and saveConfig() */
virtual void accept();
void accept() Q_DECL_OVERRIDE;
/** save current settings */
void saveConfig();
......
......@@ -70,13 +70,13 @@ namespace Kwave
* Shows a dialog for setting up the filter plugin
* @see Kwave::Plugin::setup
*/
virtual QStringList *setup(QStringList &previous_params);
QStringList *setup(QStringList &previous_params) Q_DECL_OVERRIDE;
/**
* Does the filter operation and/or pre-listen
* @param params list of strings with parameters
*/
virtual void run(QStringList params);
void run(QStringList params) Q_DECL_OVERRIDE;
/**
* Returns true if the parameters have changed during pre-listen.
......@@ -105,7 +105,7 @@ namespace Kwave
* Returns a text for the progress dialog if enabled.
* (should already be localized)
*/
virtual QString progressText();
QString progressText() Q_DECL_OVERRIDE;
signals:
......
......@@ -59,7 +59,7 @@ namespace Kwave
virtual void setFilter(Kwave::TransmissionFunction *func);
/** @see QWidget::paintEvent() */
virtual void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
private:
......
......@@ -81,11 +81,11 @@ namespace Kwave
protected:
void mouseMoveEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
private:
/**
......
......@@ -59,7 +59,7 @@ namespace Kwave
* Returns flags describing the possible interactions with this object
* @see Kwave::ViewItem::Flags
*/
virtual Kwave::ViewItem::Flags flags() const;
Kwave::ViewItem::Flags flags() const Q_DECL_OVERRIDE;
/**
* Can be overwritten to return a tooltip.
......@@ -67,31 +67,31 @@ namespace Kwave
* @param ofs sample index the tooltip should refer to (unused)
* @return an already localized tooltip
*/
virtual QString toolTip(sample_index_t &ofs);
QString toolTip(sample_index_t &ofs) Q_DECL_OVERRIDE;
/**
* Called to append entries to a context menu.
* @param parent context menu to add items
*/
virtual void appendContextMenu(QMenu *parent);
void appendContextMenu(QMenu *parent) Q_DECL_OVERRIDE;
/**
* Returns a mouse cursor used when moving the item
*/
virtual QCursor mouseCursor() const;
QCursor mouseCursor() const Q_DECL_OVERRIDE;
/**
* handles updates when being moved with the mouse
* @param mouse_pos position of the mouse, in pixel coordinates
* relative to the parent widget
*/
virtual void moveTo(const QPoint &mouse_pos);
void moveTo(const QPoint &mouse_pos) Q_DECL_OVERRIDE;
/**
* Called when leaving the move mode, when the mouse button
* has been released.
*/
virtual void done();
void done() Q_DECL_OVERRIDE;
private slots:
......
......@@ -59,31 +59,31 @@ namespace Kwave
/**
* Called to notify the item that it has been selected.
*/
virtual void actionSelected();
void actionSelected() Q_DECL_OVERRIDE;
/**
* Handles/interpretes special menu commands.
* @param command name of a menu node or command
* @return true if the name was recognized as a command and handled
*/
virtual bool specialCommand(const QString &command);
bool specialCommand(const QString &command) Q_DECL_OVERRIDE;
/**
* Shows/hides the current menu node.
* @param visible true to show the item, false to hide
*/
virtual void setVisible(bool visible);
void setVisible(bool visible) Q_DECL_OVERRIDE;
/**
* Returns true if the node is enabled.
*/
virtual bool isEnabled();
bool isEnabled() Q_DECL_OVERRIDE;
/**
* Enables/disables the current menu node.
* @param enable true to enable the item, false to disable
*/
virtual void setEnabled(bool enable);
void setEnabled(bool enable) Q_DECL_OVERRIDE;
/**
* Enables/disabled checking/selecting the item
......@@ -98,28 +98,28 @@ namespace Kwave
* Sets/removes the checkmark from the current menu item.
* @param check true to set the mark, false to remove
*/
virtual void setChecked(bool check);
void setChecked(bool check) Q_DECL_OVERRIDE;
/**
* Sets the visible text of an item to a new value. (Only useful
* for a MenuItem)
* @param text the new text
*/
virtual void setText(const QString &text);
void setText(const QString &text) Q_DECL_OVERRIDE;
/**
* Returns the menu nodes' icon.
*/
virtual const QIcon icon();
const QIcon icon() Q_DECL_OVERRIDE;
/**
* Sets a new icon of a menu node.
* @param icon QPixmap with the icon
*/
virtual void setIcon(const QIcon &icon);
void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
/** Returns the corresponding menu action */
virtual QAction *action() { return &m_action; }
QAction *action() Q_DECL_OVERRIDE { return &m_action; }
private slots:
......
......@@ -56,12 +56,12 @@ namespace Kwave
/**
* Always returns true, as the nodes of this type are no branches.
*/
virtual bool isBranch() const { return false; }
bool isBranch() const Q_DECL_OVERRIDE { return false; }
/**
* Removes all entries from the list menu.
*/
virtual void clear();
void clear() Q_DECL_OVERRIDE;
/**
* Inserts a new leaf node under the corresponding submenu.
......@@ -73,10 +73,10 @@ namespace Kwave
* @param uid unique id string (might be 0)
* @return pointer to the new leaf node
*/
virtual Kwave::MenuNode *insertLeaf(const QString &name,
Kwave::MenuNode *insertLeaf(const QString &name,
const QString &command,
const QKeySequence &shortcut,
const QString &uid);
const QString &uid) Q_DECL_OVERRIDE;
};
}
......
......@@ -65,11 +65,11 @@ namespace Kwave
* @param shortcut keyboard shortcut, 0 if unused
* @param uid unique id string (might be 0)
*/
virtual void insertNode(const QString &name,
void insertNode(const QString &name,
const QString &position,
const QString &command,
const QKeySequence &shortcut,
const QString &uid);
const QString &uid) Q_DECL_OVERRIDE;
/**
* Inserts a new branch node into the menu structure.
......@@ -86,10 +86,10 @@ namespace Kwave
* @param uid unique id string (might be 0)
* @return pointer to the new branch node
*/
virtual Kwave::MenuSub *insertBranch(const QString &name,
Kwave::MenuSub *insertBranch(const QString &name,
const QString &command,
const QKeySequence &shortcut,
const QString &uid);
const QString &uid) Q_DECL_OVERRIDE;
/**
* Inserts a new leaf node into the menu structure. The new node
......@@ -101,29 +101,29 @@ namespace Kwave
* @param uid unique id string (might be 0)
* @return pointer to the new leaf node
*/
virtual Kwave::MenuNode *insertLeaf(const QString &name,
Kwave::MenuNode *insertLeaf(const QString &name,
const QString &command,
const QKeySequence &shortcut,
const QString &uid);
const QString &uid) Q_DECL_OVERRIDE;
/**
* Removes a child node of the current node. If the child
* was not found or is already removed this does nothing.
* @param child pointer to the child node
*/
virtual void removeChild(Kwave::MenuNode *child);
void removeChild(Kwave::MenuNode *child) Q_DECL_OVERRIDE;
/**
* Handles/interprets special menu commands.
* @param command name of a menu node or command
* @return true if the name was recognized as a command and handled
*/
virtual bool specialCommand(const QString &command);
bool specialCommand(const QString &command) Q_DECL_OVERRIDE;
/**
* Returns a pointer to the list of groups
*/
virtual QHash<QString, Kwave::MenuGroup *> &groupList();
QHash<QString, Kwave::MenuGroup *> &groupList() Q_DECL_OVERRIDE;
/**
* replacement for QObject::deleteLater(...), which does not work
......
......@@ -61,7 +61,7 @@ namespace Kwave
/**
* Always returns true, as the nodes of this type are branches.
*/
virtual bool isBranch() const { return true; }
bool isBranch() const Q_DECL_OVERRIDE { return true; }
/**
* Inserts a new branch node under the submenu. The new node
......@@ -78,10 +78,10 @@ namespace Kwave
* @param uid unique id string (might be 0)
* @return pointer to the new branch node
*/
virtual Kwave::MenuSub *insertBranch(const QString &name,
Kwave::MenuSub *insertBranch(const QString &name,
const QString &command,
const QKeySequence &shortcut,
const QString &uid);
const QString &uid) Q_DECL_OVERRIDE;
/**
* Inserts a new leaf node under the submenu. The new node
......@@ -93,13 +93,13 @@ namespace Kwave
* @param uid unique id string (might be 0)
* @return pointer to the new leaf node
*/
virtual Kwave::MenuNode *insertLeaf(const QString &name,
Kwave::MenuNode *insertLeaf(const QString &name,
const QString &command,
const QKeySequence &shortcut,
const QString &uid);
const QString &uid) Q_DECL_OVERRIDE;
/** Returns the corresponding menu action */
virtual QAction *action() {
QAction *action() Q_DECL_OVERRIDE {
return (m_menu) ? m_menu->menuAction() : 0;
}
......@@ -108,40 +108,40 @@ namespace Kwave
* was not found or is already removed this does nothing.
* @param child pointer to the child node
*/
virtual void removeChild(Kwave::MenuNode *child);
void removeChild(Kwave::MenuNode *child) Q_DECL_OVERRIDE;
/**
* Handles/interpretes special menu commands.
* @param command name of a menu node or command
* @return true if the name was recognized as a command and handled
*/
virtual bool specialCommand(const QString &command);
bool specialCommand(const QString &command) Q_DECL_OVERRIDE;
/**
* Shows/hides the current sub menu.
* @param visible true to show the sub menu, false to hide
*/
virtual void setVisible(bool visible);
void setVisible(bool visible) Q_DECL_OVERRIDE;
/**
* Returns true if the node is enabled.
*/
virtual bool isEnabled();
bool isEnabled() Q_DECL_OVERRIDE;
/**
* Enables/disables the current menu node.
* @param enable true to enable the item, false to disable
*/
virtual void setEnabled(bool enable);
void setEnabled(bool enable) Q_DECL_OVERRIDE;
/** Returns the menu nodes' icon. */
virtual const QIcon icon();
const QIcon icon() Q_DECL_OVERRIDE;
/**
* Sets a new icon of a menu node.
* @param icon QPixmap with the icon
*/
virtual void setIcon(const QIcon &icon);
void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
protected:
friend class MenuRoot;
......
......@@ -100,10 +100,10 @@ namespace Kwave
private:
/** reacts to the mouse release (click) */
virtual void mouseReleaseEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
/** repaints the pixmap */
virtual void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
private:
......
......@@ -59,7 +59,7 @@ namespace Kwave
virtual QSize minimumSize() const;
/** optimal size for the widget, @see QWidget::sizeHint() */
virtual QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
public slots:
......@@ -96,19 +96,19 @@ namespace Kwave
protected:
/** refreshes the bitmap when resized */
void resizeEvent(QResizeEvent *);
void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
/**
* On mouse move:
* move the current viewport center to the clicked position.
*/
void mouseMoveEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
/**
* On single-click with the left mouse button:
* move the current viewport center to the clicked position.
*/
void mousePressEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
/**
* On double click with the left mouse button, without shift:
......@@ -119,7 +119,7 @@ namespace Kwave
* The same as above, but zoom out instead of in
* (by sending "view:zoom_out()").
*/
void mouseDoubleClickEvent(QMouseEvent *e);
void mouseDoubleClickEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
protected slots:
......@@ -184,7 +184,7 @@ namespace Kwave
virtual ~WorkerThread();
/** thread function that calls calculateBitmap() */
virtual void run();
void run() Q_DECL_OVERRIDE;
private:
......
......@@ -76,7 +76,7 @@ namespace Kwave
virtual QSize minimumSize() const;
/** optimal size for the widget, @see QWidget::sizeHint() */
virtual QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
protected:
......@@ -84,7 +84,7 @@ namespace Kwave
* Draws the widget.
* @see QWidget::paintEvent
*/
void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
/**
* Draws a linear scale
......
......@@ -56,7 +56,7 @@ namespace Kwave
* Returns flags describing the possible interactions with this object
* @see Kwave::ViewItem::Flags
*/
virtual Kwave::ViewItem::Flags flags() const;
Kwave::ViewItem::Flags flags() const Q_DECL_OVERRIDE;
/**
* Can be overwritten to return a tooltip. The default implementation
......@@ -65,19 +65,19 @@ namespace Kwave
* @param ofs sample index the tooltip should refer to (unused)
* @return an already localized tooltip
*/
virtual QString toolTip(sample_index_t &ofs);
QString toolTip(sample_index_t &ofs) Q_DECL_OVERRIDE;
/**
* Returns a mouse cursor used when moving the item
*/
virtual QCursor mouseCursor() const;
QCursor mouseCursor() const Q_DECL_OVERRIDE;
/**
* handles updates when being moved with the mouse
* @param mouse_pos position of the mouse, in pixel coordinates
* relative to the parent widget
*/
virtual void moveTo(const QPoint &mouse_pos);
void moveTo(const QPoint &mouse_pos) Q_DECL_OVERRIDE;
private: