From e144f7c85ae874ff83aa9d1ff2d500714556d13b Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Fri, 29 Jun 2012 14:37:29 +0200 Subject: [PATCH] Mark overriden methods as Q_DECL_OVERRIDE. --- src/gui/Application.h | 4 +++- src/gui/DialogyWidget.h | 2 +- src/gui/DragTabBar.h | 10 +++++----- src/gui/IconModels.h | 8 ++++---- src/gui/KeePass1OpenWidget.h | 2 +- src/gui/LineEdit.h | 2 +- src/gui/MainWindow.h | 2 +- src/gui/entry/EntryAttachmentsModel.h | 6 +++--- src/gui/entry/EntryAttributesModel.h | 12 ++++++------ src/gui/entry/EntryHistoryModel.h | 8 ++++---- src/gui/entry/EntryModel.h | 16 ++++++++-------- src/gui/entry/EntryView.h | 2 +- src/gui/group/GroupModel.h | 18 +++++++++--------- src/gui/group/GroupView.h | 2 +- src/streams/HashedBlockStream.h | 4 ++-- src/streams/LayeredStream.h | 10 ++++++---- src/streams/SymmetricCipherStream.h | 4 ++-- 17 files changed, 58 insertions(+), 54 deletions(-) diff --git a/src/gui/Application.h b/src/gui/Application.h index b620d7b41..c66f271bb 100644 --- a/src/gui/Application.h +++ b/src/gui/Application.h @@ -20,6 +20,8 @@ #include +#include "core/Global.h" + class Application : public QApplication { Q_OBJECT @@ -27,7 +29,7 @@ class Application : public QApplication public: Application(int& argc, char** argv); - bool event(QEvent* event); + bool event(QEvent* event) Q_DECL_OVERRIDE; Q_SIGNALS: void openFile(const QString& filename); diff --git a/src/gui/DialogyWidget.h b/src/gui/DialogyWidget.h index 68ca6a088..b7fc45c8e 100644 --- a/src/gui/DialogyWidget.h +++ b/src/gui/DialogyWidget.h @@ -31,7 +31,7 @@ public: explicit DialogyWidget(QWidget* parent = Q_NULLPTR); protected: - virtual void keyPressEvent(QKeyEvent* e); + virtual void keyPressEvent(QKeyEvent* e) Q_DECL_OVERRIDE; private: bool clickButton(QDialogButtonBox::StandardButton standardButton); diff --git a/src/gui/DragTabBar.h b/src/gui/DragTabBar.h index 9b265a505..dec7caa98 100644 --- a/src/gui/DragTabBar.h +++ b/src/gui/DragTabBar.h @@ -30,11 +30,11 @@ public: explicit DragTabBar(QWidget* parent = Q_NULLPTR); protected: - void dragEnterEvent(QDragEnterEvent* event); - void dragMoveEvent(QDragMoveEvent* event); - void dragLeaveEvent(QDragLeaveEvent* event); - void dropEvent(QDropEvent* event); - void tabLayoutChange(); + void dragEnterEvent(QDragEnterEvent* event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent* event) Q_DECL_OVERRIDE; + void dragLeaveEvent(QDragLeaveEvent* event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent* event) Q_DECL_OVERRIDE; + void tabLayoutChange() Q_DECL_OVERRIDE; private Q_SLOTS: void dragSwitchTab(); diff --git a/src/gui/IconModels.h b/src/gui/IconModels.h index bc3b3ffd0..ff65bf1f3 100644 --- a/src/gui/IconModels.h +++ b/src/gui/IconModels.h @@ -31,8 +31,8 @@ class DefaultIconModel : public QAbstractListModel public: explicit DefaultIconModel(QObject* parent = Q_NULLPTR); - int rowCount(const QModelIndex& parent = QModelIndex()) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; }; class CustomIconModel : public QAbstractListModel @@ -42,8 +42,8 @@ class CustomIconModel : public QAbstractListModel public: explicit CustomIconModel(QObject* parent = Q_NULLPTR); - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; void setIcons(const QHash& icons, const QList& iconsOrder); Uuid uuidFromIndex(const QModelIndex& index) const; QModelIndex indexFromUuid(const Uuid& uuid) const; diff --git a/src/gui/KeePass1OpenWidget.h b/src/gui/KeePass1OpenWidget.h index 449d2c6f8..5059f3395 100644 --- a/src/gui/KeePass1OpenWidget.h +++ b/src/gui/KeePass1OpenWidget.h @@ -29,7 +29,7 @@ public: ~KeePass1OpenWidget(); protected: - void openDatabase(); + void openDatabase() Q_DECL_OVERRIDE; }; #endif // KEEPASSX_KEEPASS1OPENWIDGET_H diff --git a/src/gui/LineEdit.h b/src/gui/LineEdit.h index de7e74210..8ee2c8107 100644 --- a/src/gui/LineEdit.h +++ b/src/gui/LineEdit.h @@ -34,7 +34,7 @@ public: explicit LineEdit(QWidget* parent = Q_NULLPTR); protected: - void resizeEvent(QResizeEvent* event); + void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE; private Q_SLOTS: void updateCloseButton(const QString& text); diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index 1f0b2f729..5c4f23e75 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -39,7 +39,7 @@ public Q_SLOTS: const QString& keyFile = QString()); protected: - void closeEvent(QCloseEvent* event); + void closeEvent(QCloseEvent* event) Q_DECL_OVERRIDE; private Q_SLOTS: void setMenuActionState(DatabaseWidget::Mode mode = DatabaseWidget::None); diff --git a/src/gui/entry/EntryAttachmentsModel.h b/src/gui/entry/EntryAttachmentsModel.h index 19900b27b..7668013f9 100644 --- a/src/gui/entry/EntryAttachmentsModel.h +++ b/src/gui/entry/EntryAttachmentsModel.h @@ -31,9 +31,9 @@ class EntryAttachmentsModel : public QAbstractListModel public: explicit EntryAttachmentsModel(QObject* parent = Q_NULLPTR); void setEntryAttachments(EntryAttachments* entry); - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; QString keyByIndex(const QModelIndex& index) const; private Q_SLOTS: diff --git a/src/gui/entry/EntryAttributesModel.h b/src/gui/entry/EntryAttributesModel.h index 286f38f73..421921f4e 100644 --- a/src/gui/entry/EntryAttributesModel.h +++ b/src/gui/entry/EntryAttributesModel.h @@ -31,12 +31,12 @@ class EntryAttributesModel : public QAbstractListModel public: explicit EntryAttributesModel(QObject* parent = Q_NULLPTR); void setEntryAttributes(EntryAttributes* entryAttributes); - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - Qt::ItemFlags flags(const QModelIndex& index) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex& index) const Q_DECL_OVERRIDE; QModelIndex indexByKey(const QString& key) const; QString keyByIndex(const QModelIndex& index) const; diff --git a/src/gui/entry/EntryHistoryModel.h b/src/gui/entry/EntryHistoryModel.h index a2150c434..dd013f82f 100644 --- a/src/gui/entry/EntryHistoryModel.h +++ b/src/gui/entry/EntryHistoryModel.h @@ -32,10 +32,10 @@ public: explicit EntryHistoryModel(QObject* parent = Q_NULLPTR); Entry* entryFromIndex(const QModelIndex& index) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - int rowCount(const QModelIndex& parent = QModelIndex()) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; + int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE; void setEntries(const QList& entries); void clear(); diff --git a/src/gui/entry/EntryModel.h b/src/gui/entry/EntryModel.h index 2f4aa4213..4c718897d 100644 --- a/src/gui/entry/EntryModel.h +++ b/src/gui/entry/EntryModel.h @@ -34,14 +34,14 @@ public: Entry* entryFromIndex(const QModelIndex& index) const; QModelIndex indexFromEntry(Entry* entry) const; - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - Qt::DropActions supportedDropActions() const; - Qt::ItemFlags flags(const QModelIndex& modelIndex) const; - QStringList mimeTypes() const; - QMimeData* mimeData(const QModelIndexList& indexes) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex& modelIndex) const Q_DECL_OVERRIDE; + QStringList mimeTypes() const Q_DECL_OVERRIDE; + QMimeData* mimeData(const QModelIndexList& indexes) const Q_DECL_OVERRIDE; void setEntries(const QList& entries); diff --git a/src/gui/entry/EntryView.h b/src/gui/entry/EntryView.h index a98b6f97e..c93287297 100644 --- a/src/gui/entry/EntryView.h +++ b/src/gui/entry/EntryView.h @@ -33,7 +33,7 @@ class EntryView : public QTreeView public: explicit EntryView(QWidget* parent = Q_NULLPTR); - void setModel(QAbstractItemModel* model); + void setModel(QAbstractItemModel* model) Q_DECL_OVERRIDE; Entry* currentEntry(); bool isSingleEntrySelected(); void setCurrentEntry(Entry* entry); diff --git a/src/gui/group/GroupModel.h b/src/gui/group/GroupModel.h index f21bf9ef5..f3ef51643 100644 --- a/src/gui/group/GroupModel.h +++ b/src/gui/group/GroupModel.h @@ -37,16 +37,16 @@ public: int rowCount(const QModelIndex& parent = QModelIndex()) const; int columnCount(const QModelIndex& parent = QModelIndex()) const; - QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex& index) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - Qt::DropActions supportedDropActions() const; - Qt::ItemFlags flags(const QModelIndex& modelIndex) const; + QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex& index) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex& modelIndex) const Q_DECL_OVERRIDE; bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, - const QModelIndex& parent); - QStringList mimeTypes() const; - QMimeData* mimeData(const QModelIndexList& indexes) const; + const QModelIndex& parent) Q_DECL_OVERRIDE; + QStringList mimeTypes() const Q_DECL_OVERRIDE; + QMimeData* mimeData(const QModelIndexList& indexes) const Q_DECL_OVERRIDE; private: QModelIndex parent(Group* group) const; diff --git a/src/gui/group/GroupView.h b/src/gui/group/GroupView.h index 14b115a15..eff83aefd 100644 --- a/src/gui/group/GroupView.h +++ b/src/gui/group/GroupView.h @@ -33,7 +33,7 @@ class GroupView : public QTreeView public: explicit GroupView(Database* db, QWidget* parent = Q_NULLPTR); void changeDatabase(Database* newDb); - void setModel(QAbstractItemModel* model); + void setModel(QAbstractItemModel* model) Q_DECL_OVERRIDE; Group* currentGroup(); void setCurrentGroup(Group* group); void expandGroup(Group* group, bool expand = true); diff --git a/src/streams/HashedBlockStream.h b/src/streams/HashedBlockStream.h index 3f9419ac0..106bcf0fa 100644 --- a/src/streams/HashedBlockStream.h +++ b/src/streams/HashedBlockStream.h @@ -35,8 +35,8 @@ public: void close(); protected: - qint64 readData(char* data, qint64 maxSize); - qint64 writeData(const char* data, qint64 maxSize); + qint64 readData(char* data, qint64 maxSize) Q_DECL_OVERRIDE; + qint64 writeData(const char* data, qint64 maxSize) Q_DECL_OVERRIDE; private: void init(); diff --git a/src/streams/LayeredStream.h b/src/streams/LayeredStream.h index f366c63d0..3aca46581 100644 --- a/src/streams/LayeredStream.h +++ b/src/streams/LayeredStream.h @@ -20,6 +20,8 @@ #include +#include "core/Global.h" + class LayeredStream : public QIODevice { Q_OBJECT @@ -28,13 +30,13 @@ public: explicit LayeredStream(QIODevice* baseDevice); virtual ~LayeredStream(); - bool isSequential() const; + bool isSequential() const Q_DECL_OVERRIDE; virtual QString errorString() const; - bool open(QIODevice::OpenMode mode); + bool open(QIODevice::OpenMode mode) Q_DECL_OVERRIDE; protected: - qint64 readData(char* data, qint64 maxSize); - qint64 writeData(const char* data, qint64 maxSize); + qint64 readData(char* data, qint64 maxSize) Q_DECL_OVERRIDE; + qint64 writeData(const char* data, qint64 maxSize) Q_DECL_OVERRIDE; QIODevice* const m_baseDevice; diff --git a/src/streams/SymmetricCipherStream.h b/src/streams/SymmetricCipherStream.h index 6a4c9fdee..96cb6476d 100644 --- a/src/streams/SymmetricCipherStream.h +++ b/src/streams/SymmetricCipherStream.h @@ -36,8 +36,8 @@ public: void close(); protected: - qint64 readData(char* data, qint64 maxSize); - qint64 writeData(const char* data, qint64 maxSize); + qint64 readData(char* data, qint64 maxSize) Q_DECL_OVERRIDE; + qint64 writeData(const char* data, qint64 maxSize) Q_DECL_OVERRIDE; private: bool readBlock();