From 47c92fbb0b588b443cead18a5aad5a2b5ad9e4d7 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 18 Sep 2017 10:36:49 +0200 Subject: Replace Q_DECL_OVERRIDE with override where possible Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll Reviewed-by: Ville Voutilainen Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/itemviews/qabstractitemview.h | 38 +++++++------- src/widgets/itemviews/qcolumnview.h | 36 +++++++------- src/widgets/itemviews/qcolumnview_p.h | 26 +++++----- src/widgets/itemviews/qcolumnviewgrip_p.h | 10 ++-- src/widgets/itemviews/qdirmodel.h | 28 +++++------ src/widgets/itemviews/qheaderview.h | 52 +++++++++---------- src/widgets/itemviews/qitemdelegate.h | 16 +++--- src/widgets/itemviews/qitemeditorfactory.cpp | 4 +- src/widgets/itemviews/qitemeditorfactory_p.h | 2 +- src/widgets/itemviews/qlistview.h | 66 ++++++++++++------------- src/widgets/itemviews/qlistwidget.h | 8 +-- src/widgets/itemviews/qstyleditemdelegate.h | 16 +++--- src/widgets/itemviews/qtableview.cpp | 2 +- src/widgets/itemviews/qtableview.h | 52 +++++++++---------- src/widgets/itemviews/qtablewidget.h | 6 +-- src/widgets/itemviews/qtreeview.h | 74 ++++++++++++++-------------- src/widgets/itemviews/qtreewidget.h | 8 +-- src/widgets/itemviews/qtreewidget_p.h | 40 +++++++-------- 18 files changed, 242 insertions(+), 242 deletions(-) (limited to 'src/widgets/itemviews') diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h index 6a007da348..676b6cb21e 100644 --- a/src/widgets/itemviews/qabstractitemview.h +++ b/src/widgets/itemviews/qabstractitemview.h @@ -225,7 +225,7 @@ public: QAbstractItemDelegate *itemDelegate(const QModelIndex &index) const; - virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; + virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const override; using QAbstractScrollArea::update; @@ -327,32 +327,32 @@ protected: void stopAutoScroll(); void doAutoScroll(); - bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE; - bool event(QEvent *event) Q_DECL_OVERRIDE; - bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + bool focusNextPrevChild(bool next) override; + bool event(QEvent *event) override; + bool viewportEvent(QEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; #ifndef QT_NO_DRAGANDDROP - 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 dragEnterEvent(QDragEnterEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; + void dropEvent(QDropEvent *event) override; #endif - void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE; + void focusInEvent(QFocusEvent *event) override; + void focusOutEvent(QFocusEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void timerEvent(QTimerEvent *event) override; + void inputMethodEvent(QInputMethodEvent *event) override; #ifndef QT_NO_DRAGANDDROP enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport }; DropIndicatorPosition dropIndicatorPosition() const; #endif - QSize viewportSizeHint() const Q_DECL_OVERRIDE; + QSize viewportSizeHint() const override; private: Q_DECLARE_PRIVATE(QAbstractItemView) diff --git a/src/widgets/itemviews/qcolumnview.h b/src/widgets/itemviews/qcolumnview.h index 42eac7426a..4f34406b21 100644 --- a/src/widgets/itemviews/qcolumnview.h +++ b/src/widgets/itemviews/qcolumnview.h @@ -62,14 +62,14 @@ public: ~QColumnView(); // QAbstractItemView overloads - QModelIndex indexAt(const QPoint &point) const Q_DECL_OVERRIDE; - void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE; - QSize sizeHint() const Q_DECL_OVERRIDE; - QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE; - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; - void setSelectionModel(QItemSelectionModel * selectionModel) Q_DECL_OVERRIDE; - void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE; - void selectAll() Q_DECL_OVERRIDE; + QModelIndex indexAt(const QPoint &point) const override; + void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; + QSize sizeHint() const override; + QRect visualRect(const QModelIndex &index) const override; + void setModel(QAbstractItemModel *model) override; + void setSelectionModel(QItemSelectionModel * selectionModel) override; + void setRootIndex(const QModelIndex &index) override; + void selectAll() override; // QColumnView functions void setResizeGripsVisible(bool visible); @@ -85,18 +85,18 @@ protected: QColumnView(QColumnViewPrivate &dd, QWidget *parent = Q_NULLPTR); // QAbstractItemView overloads - bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE; - QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; - void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE; - QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE; - int horizontalOffset() const Q_DECL_OVERRIDE; - int verticalOffset() const Q_DECL_OVERRIDE; - void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; - void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; + bool isIndexHidden(const QModelIndex &index) const override; + QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override; + void resizeEvent(QResizeEvent *event) override; + void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) override; + QRegion visualRegionForSelection(const QItemSelection &selection) const override; + int horizontalOffset() const override; + int verticalOffset() const override; + void rowsInserted(const QModelIndex &parent, int start, int end) override; + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; // QColumnView functions - void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE; + void scrollContentsBy(int dx, int dy) override; virtual QAbstractItemView* createColumn(const QModelIndex &rootIndex); void initializeColumn(QAbstractItemView *column) const; diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h index fa276075fe..850ab02747 100644 --- a/src/widgets/itemviews/qcolumnview_p.h +++ b/src/widgets/itemviews/qcolumnview_p.h @@ -80,7 +80,7 @@ public: setMinimumWidth(previewWidget->minimumWidth()); } - void resizeEvent(QResizeEvent * event) Q_DECL_OVERRIDE{ + void resizeEvent(QResizeEvent * event) override{ if (!previewWidget) return; previewWidget->resize( @@ -96,7 +96,7 @@ public: QAbstractScrollArea::resizeEvent(event); } - void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE + void scrollContentsBy(int dx, int dy) override { if (!previewWidget) return; @@ -106,36 +106,36 @@ public: QAbstractItemView::scrollContentsBy(dx, dy); } - QRect visualRect(const QModelIndex &) const Q_DECL_OVERRIDE + QRect visualRect(const QModelIndex &) const override { return QRect(); } - void scrollTo(const QModelIndex &, ScrollHint) Q_DECL_OVERRIDE + void scrollTo(const QModelIndex &, ScrollHint) override { } - QModelIndex indexAt(const QPoint &) const Q_DECL_OVERRIDE + QModelIndex indexAt(const QPoint &) const override { return QModelIndex(); } - QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) Q_DECL_OVERRIDE + QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override { return QModelIndex(); } - int horizontalOffset () const Q_DECL_OVERRIDE { + int horizontalOffset () const override { return 0; } - int verticalOffset () const Q_DECL_OVERRIDE { + int verticalOffset () const override { return 0; } - QRegion visualRegionForSelection(const QItemSelection &) const Q_DECL_OVERRIDE + QRegion visualRegionForSelection(const QItemSelection &) const override { return QRegion(); } - bool isIndexHidden(const QModelIndex &) const Q_DECL_OVERRIDE + bool isIndexHidden(const QModelIndex &) const override { return false; } - void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) Q_DECL_OVERRIDE + void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) override { } private: @@ -163,7 +163,7 @@ public: void _q_gripMoved(int offset); void _q_changeCurrentColumn(); void _q_clicked(const QModelIndex &index); - void _q_columnsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; + void _q_columnsInserted(const QModelIndex &parent, int start, int end) override; QList columns; QVector columnSizes; // used during init and corner moving @@ -188,7 +188,7 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; }; QT_END_NAMESPACE diff --git a/src/widgets/itemviews/qcolumnviewgrip_p.h b/src/widgets/itemviews/qcolumnviewgrip_p.h index 16c0aefada..7e2793074b 100644 --- a/src/widgets/itemviews/qcolumnviewgrip_p.h +++ b/src/widgets/itemviews/qcolumnviewgrip_p.h @@ -74,11 +74,11 @@ public: protected: QColumnViewGrip(QColumnViewGripPrivate &, QWidget *parent = 0, Qt::WindowFlags f = 0); - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; private: Q_DECLARE_PRIVATE(QColumnViewGrip) diff --git a/src/widgets/itemviews/qdirmodel.h b/src/widgets/itemviews/qdirmodel.h index 30810cf4f6..30486c2e67 100644 --- a/src/widgets/itemviews/qdirmodel.h +++ b/src/widgets/itemviews/qdirmodel.h @@ -70,27 +70,27 @@ public: explicit QDirModel(QObject *parent = Q_NULLPTR); ~QDirModel(); - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const 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; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - bool hasChildren(const QModelIndex &index = QModelIndex()) const Q_DECL_OVERRIDE; - Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool hasChildren(const QModelIndex &index = QModelIndex()) const override; + Qt::ItemFlags flags(const QModelIndex &index) const override; - void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE; + void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; - QStringList mimeTypes() const Q_DECL_OVERRIDE; - QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE; + QStringList mimeTypes() const override; + QMimeData *mimeData(const QModelIndexList &indexes) const override; bool dropMimeData(const QMimeData *data, Qt::DropAction action, - int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE; - Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE; + int row, int column, const QModelIndex &parent) override; + Qt::DropActions supportedDropActions() const override; // QDirModel specific API diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h index ec4500d81e..91217a69a3 100644 --- a/src/widgets/itemviews/qheaderview.h +++ b/src/widgets/itemviews/qheaderview.h @@ -77,13 +77,13 @@ public: explicit QHeaderView(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR); virtual ~QHeaderView(); - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; + void setModel(QAbstractItemModel *model) override; Qt::Orientation orientation() const; int offset() const; int length() const; - QSize sizeHint() const Q_DECL_OVERRIDE; - void setVisible(bool v) Q_DECL_OVERRIDE; + QSize sizeHint() const override; + void setVisible(bool v) override; int sectionSizeHint(int logicalIndex) const; int visualIndexAt(int position) const; @@ -172,7 +172,7 @@ public: Qt::Alignment defaultAlignment() const; void setDefaultAlignment(Qt::Alignment alignment); - void doItemsLayout() Q_DECL_OVERRIDE; + void doItemsLayout() override; bool sectionsMoved() const; bool sectionsHidden() const; @@ -181,7 +181,7 @@ public: bool restoreState(const QByteArray &state); #endif - void reset() Q_DECL_OVERRIDE; + void reset() override; public Q_SLOTS: void setOffset(int offset); @@ -213,36 +213,36 @@ protected: void initializeSections(); void initializeSections(int start, int end); - void currentChanged(const QModelIndex ¤t, const QModelIndex &old) Q_DECL_OVERRIDE; + void currentChanged(const QModelIndex ¤t, const QModelIndex &old) override; - bool event(QEvent *e) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - bool viewportEvent(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + void mouseDoubleClickEvent(QMouseEvent *e) override; + bool viewportEvent(QEvent *e) override; virtual void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const; virtual QSize sectionSizeFromContents(int logicalIndex) const; - int horizontalOffset() const Q_DECL_OVERRIDE; - int verticalOffset() const Q_DECL_OVERRIDE; - void updateGeometries() Q_DECL_OVERRIDE; - void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE; + int horizontalOffset() const override; + int verticalOffset() const override; + void updateGeometries() override; + void scrollContentsBy(int dx, int dy) override; - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) Q_DECL_OVERRIDE; - void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) override; + void rowsInserted(const QModelIndex &parent, int start, int end) override; - QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE; - void scrollTo(const QModelIndex &index, ScrollHint hint) Q_DECL_OVERRIDE; + QRect visualRect(const QModelIndex &index) const override; + void scrollTo(const QModelIndex &index, ScrollHint hint) override; - QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE; - bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE; + QModelIndex indexAt(const QPoint &p) const override; + bool isIndexHidden(const QModelIndex &index) const override; - QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) Q_DECL_OVERRIDE; - void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) Q_DECL_OVERRIDE; - QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE; + QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override; + void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) override; + QRegion visualRegionForSelection(const QItemSelection &selection) const override; void initStyleOption(QStyleOptionHeader *option) const; friend class QTableView; diff --git a/src/widgets/itemviews/qitemdelegate.h b/src/widgets/itemviews/qitemdelegate.h index 21594327ef..d15e15b5e4 100644 --- a/src/widgets/itemviews/qitemdelegate.h +++ b/src/widgets/itemviews/qitemdelegate.h @@ -68,21 +68,21 @@ public: // painting void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; QSize sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; // editing QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; - void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; - void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE; + void setEditorData(QWidget *editor, const QModelIndex &index) const override; + void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; // editor factory QItemEditorFactory *itemEditorFactory() const; @@ -105,9 +105,9 @@ protected: QRect rect(const QStyleOptionViewItem &option, const QModelIndex &index, int role) const; - bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *object, QEvent *event) override; bool editorEvent(QEvent *event, QAbstractItemModel *model, - const QStyleOptionViewItem &option, const QModelIndex &index) Q_DECL_OVERRIDE; + const QStyleOptionViewItem &option, const QModelIndex &index) override; QStyleOptionViewItem setOptions(const QModelIndex &index, const QStyleOptionViewItem &option) const; diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index 54b7c6666f..b1e9af1f0f 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -229,8 +229,8 @@ class QDefaultItemEditorFactory : public QItemEditorFactory { public: inline QDefaultItemEditorFactory() {} - QWidget *createEditor(int userType, QWidget *parent) const Q_DECL_OVERRIDE; - QByteArray valuePropertyName(int) const Q_DECL_OVERRIDE; + QWidget *createEditor(int userType, QWidget *parent) const override; + QByteArray valuePropertyName(int) const override; }; QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) const diff --git a/src/widgets/itemviews/qitemeditorfactory_p.h b/src/widgets/itemviews/qitemeditorfactory_p.h index 409ecc684f..1b7718192c 100644 --- a/src/widgets/itemviews/qitemeditorfactory_p.h +++ b/src/widgets/itemviews/qitemeditorfactory_p.h @@ -74,7 +74,7 @@ public: } protected: - void changeEvent(QEvent *e) Q_DECL_OVERRIDE; + void changeEvent(QEvent *e) override; public Q_SLOTS: void resizeToContents(); diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h index 66ec9b18b1..1a59b7b54a 100644 --- a/src/widgets/itemviews/qlistview.h +++ b/src/widgets/itemviews/qlistview.h @@ -125,13 +125,13 @@ public: void setSelectionRectVisible(bool show); bool isSelectionRectVisible() const; - QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE; - void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE; - QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE; + QRect visualRect(const QModelIndex &index) const override; + void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; + QModelIndex indexAt(const QPoint &p) const override; - void doItemsLayout() Q_DECL_OVERRIDE; - void reset() Q_DECL_OVERRIDE; - void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE; + void doItemsLayout() override; + void reset() override; + void setRootIndex(const QModelIndex &index) override; Q_SIGNALS: void indexesMoved(const QModelIndexList &indexes); @@ -139,53 +139,53 @@ Q_SIGNALS: protected: QListView(QListViewPrivate &, QWidget *parent = Q_NULLPTR); - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; - void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE; + void scrollContentsBy(int dx, int dy) override; void resizeContents(int width, int height); QSize contentsSize() const; - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) Q_DECL_OVERRIDE; - void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; - void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) override; + void rowsInserted(const QModelIndex &parent, int start, int end) override; + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; - void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; #if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *e) override; #endif - void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *e) override; + void resizeEvent(QResizeEvent *e) override; #ifndef QT_NO_DRAGANDDROP - void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE; - void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE; - void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE; - void startDrag(Qt::DropActions supportedActions) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *e) override; + void dragLeaveEvent(QDragLeaveEvent *e) override; + void dropEvent(QDropEvent *e) override; + void startDrag(Qt::DropActions supportedActions) override; #endif // QT_NO_DRAGANDDROP - QStyleOptionViewItem viewOptions() const Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; + QStyleOptionViewItem viewOptions() const override; + void paintEvent(QPaintEvent *e) override; - int horizontalOffset() const Q_DECL_OVERRIDE; - int verticalOffset() const Q_DECL_OVERRIDE; - QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; + int horizontalOffset() const override; + int verticalOffset() const override; + QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override; QRect rectForIndex(const QModelIndex &index) const; void setPositionForIndex(const QPoint &position, const QModelIndex &index); - void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE; - QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE; - QModelIndexList selectedIndexes() const Q_DECL_OVERRIDE; + void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override; + QRegion visualRegionForSelection(const QItemSelection &selection) const override; + QModelIndexList selectedIndexes() const override; - void updateGeometries() Q_DECL_OVERRIDE; + void updateGeometries() override; - bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool isIndexHidden(const QModelIndex &index) const override; - void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) Q_DECL_OVERRIDE; - void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; + void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override; + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; - QSize viewportSizeHint() const Q_DECL_OVERRIDE; + QSize viewportSizeHint() const override; private: int visualIndex(const QModelIndex &index) const; diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index 3416bf83a7..4fa542c8b8 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -207,7 +207,7 @@ public: explicit QListWidget(QWidget *parent = Q_NULLPTR); ~QListWidget(); - void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE; + void setSelectionModel(QItemSelectionModel *selectionModel) override; QListWidgetItem *item(int row) const; int row(const QListWidgetItem *item) const; @@ -257,7 +257,7 @@ public: protected: #endif #if QT_CONFIG(draganddrop) - void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) override; #endif public Q_SLOTS: void scrollToItem(const QListWidgetItem *item, QAbstractItemView::ScrollHint hint = EnsureVisible); @@ -278,7 +278,7 @@ Q_SIGNALS: void itemSelectionChanged(); protected: - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; virtual QStringList mimeTypes() const; #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) virtual QMimeData *mimeData(const QList &items) const; @@ -304,7 +304,7 @@ protected: QListWidgetItem *itemFromIndex(const QModelIndex &index) const; private: - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; + void setModel(QAbstractItemModel *model) override; Qt::SortOrder sortOrder() const; Q_DECLARE_PRIVATE(QListWidget) diff --git a/src/widgets/itemviews/qstyleditemdelegate.h b/src/widgets/itemviews/qstyleditemdelegate.h index f3b7c4d1f4..7fd07b8a59 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.h +++ b/src/widgets/itemviews/qstyleditemdelegate.h @@ -63,23 +63,23 @@ public: // painting void paint(QPainter *painter, - const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; + const QStyleOptionViewItem &option, const QModelIndex &index) const override; QSize sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; // editing QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; - void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; + void setEditorData(QWidget *editor, const QModelIndex &index) const override; void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, - const QModelIndex &index) const Q_DECL_OVERRIDE; + const QModelIndex &index) const override; // editor factory QItemEditorFactory *itemEditorFactory() const; @@ -91,9 +91,9 @@ protected: virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const; - bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *object, QEvent *event) override; bool editorEvent(QEvent *event, QAbstractItemModel *model, - const QStyleOptionViewItem &option, const QModelIndex &index) Q_DECL_OVERRIDE; + const QStyleOptionViewItem &option, const QModelIndex &index) override; private: Q_DECLARE_PRIVATE(QStyledItemDelegate) diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index 2d5813198c..d42ed0ad19 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -585,7 +585,7 @@ class QTableCornerButton : public QAbstractButton Q_OBJECT public: QTableCornerButton(QWidget *parent) : QAbstractButton(parent) {} - void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE { + void paintEvent(QPaintEvent*) override { QStyleOptionHeader opt; opt.init(this); QStyle::State state = QStyle::State_None; diff --git a/src/widgets/itemviews/qtableview.h b/src/widgets/itemviews/qtableview.h index 75f2e7b44c..ac43ebd11a 100644 --- a/src/widgets/itemviews/qtableview.h +++ b/src/widgets/itemviews/qtableview.h @@ -65,10 +65,10 @@ public: explicit QTableView(QWidget *parent = Q_NULLPTR); ~QTableView(); - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; - void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE; - void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE; - void doItemsLayout() Q_DECL_OVERRIDE; + void setModel(QAbstractItemModel *model) override; + void setRootIndex(const QModelIndex &index) override; + void setSelectionModel(QItemSelectionModel *selectionModel) override; + void doItemsLayout() override; QHeaderView *horizontalHeader() const; QHeaderView *verticalHeader() const; @@ -109,9 +109,9 @@ public: bool isCornerButtonEnabled() const; #endif - QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE; - void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE; - QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE; + QRect visualRect(const QModelIndex &index) const override; + void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; + QModelIndex indexAt(const QPoint &p) const override; void setSpan(int row, int column, int rowSpan, int columnSpan); int rowSpan(int row, int column) const; @@ -144,37 +144,37 @@ protected Q_SLOTS: protected: QTableView(QTableViewPrivate &, QWidget *parent); - void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE; + void scrollContentsBy(int dx, int dy) override; - QStyleOptionViewItem viewOptions() const Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; + QStyleOptionViewItem viewOptions() const override; + void paintEvent(QPaintEvent *e) override; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *event) override; - int horizontalOffset() const Q_DECL_OVERRIDE; - int verticalOffset() const Q_DECL_OVERRIDE; - QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; + int horizontalOffset() const override; + int verticalOffset() const override; + QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override; - void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE; - QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE; - QModelIndexList selectedIndexes() const Q_DECL_OVERRIDE; + void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override; + QRegion visualRegionForSelection(const QItemSelection &selection) const override; + QModelIndexList selectedIndexes() const override; - void updateGeometries() Q_DECL_OVERRIDE; + void updateGeometries() override; - QSize viewportSizeHint() const Q_DECL_OVERRIDE; + QSize viewportSizeHint() const override; - int sizeHintForRow(int row) const Q_DECL_OVERRIDE; - int sizeHintForColumn(int column) const Q_DECL_OVERRIDE; + int sizeHintForRow(int row) const override; + int sizeHintForColumn(int column) const override; - void verticalScrollbarAction(int action) Q_DECL_OVERRIDE; - void horizontalScrollbarAction(int action) Q_DECL_OVERRIDE; + void verticalScrollbarAction(int action) override; + void horizontalScrollbarAction(int action) override; - bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool isIndexHidden(const QModelIndex &index) const override; void selectionChanged(const QItemSelection &selected, - const QItemSelection &deselected) Q_DECL_OVERRIDE; + const QItemSelection &deselected) override; void currentChanged(const QModelIndex ¤t, - const QModelIndex &previous) Q_DECL_OVERRIDE; + const QModelIndex &previous) override; private: friend class QAccessibleItemView; diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h index fa51546b50..3e713a68e1 100644 --- a/src/widgets/itemviews/qtablewidget.h +++ b/src/widgets/itemviews/qtablewidget.h @@ -318,7 +318,7 @@ Q_SIGNALS: void currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn); protected: - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; virtual QStringList mimeTypes() const; #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) virtual QMimeData *mimeData(const QList &items) const; @@ -343,10 +343,10 @@ protected: protected: #if QT_CONFIG(draganddrop) - void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) override; #endif private: - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; + void setModel(QAbstractItemModel *model) override; Q_DECLARE_PRIVATE(QTableWidget) Q_DISABLE_COPY(QTableWidget) diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h index e9bc8189f8..c7b659839a 100644 --- a/src/widgets/itemviews/qtreeview.h +++ b/src/widgets/itemviews/qtreeview.h @@ -71,9 +71,9 @@ public: explicit QTreeView(QWidget *parent = Q_NULLPTR); ~QTreeView(); - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; - void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE; - void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE; + void setModel(QAbstractItemModel *model) override; + void setRootIndex(const QModelIndex &index) override; + void setSelectionModel(QItemSelectionModel *selectionModel) override; QHeaderView *header() const; void setHeader(QHeaderView *header); @@ -132,21 +132,21 @@ public: void setTreePosition(int logicalIndex); int treePosition() const; - void keyboardSearch(const QString &search) Q_DECL_OVERRIDE; + void keyboardSearch(const QString &search) override; - QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE; - void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE; - QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE; + QRect visualRect(const QModelIndex &index) const override; + void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; + QModelIndex indexAt(const QPoint &p) const override; QModelIndex indexAbove(const QModelIndex &index) const; QModelIndex indexBelow(const QModelIndex &index) const; - void doItemsLayout() Q_DECL_OVERRIDE; - void reset() Q_DECL_OVERRIDE; + void doItemsLayout() override; + void reset() override; void sortByColumn(int column, Qt::SortOrder order); - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) Q_DECL_OVERRIDE; - void selectAll() Q_DECL_OVERRIDE; + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) override; + void selectAll() override; Q_SIGNALS: void expanded(const QModelIndex &index); @@ -169,24 +169,24 @@ protected Q_SLOTS: void columnMoved(); void reexpand(); void rowsRemoved(const QModelIndex &parent, int first, int last); - void verticalScrollbarValueChanged(int value) Q_DECL_OVERRIDE; + void verticalScrollbarValueChanged(int value) override; protected: QTreeView(QTreeViewPrivate &dd, QWidget *parent = Q_NULLPTR); - void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE; - void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; - void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; + void scrollContentsBy(int dx, int dy) override; + void rowsInserted(const QModelIndex &parent, int start, int end) override; + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; - QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; - int horizontalOffset() const Q_DECL_OVERRIDE; - int verticalOffset() const Q_DECL_OVERRIDE; + QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override; + int horizontalOffset() const override; + int verticalOffset() const override; - void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE; - QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE; - QModelIndexList selectedIndexes() const Q_DECL_OVERRIDE; + void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override; + QRegion visualRegionForSelection(const QItemSelection &selection) const override; + QModelIndexList selectedIndexes() const override; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *event) override; + void paintEvent(QPaintEvent *event) override; void drawTree(QPainter *painter, const QRegion ®ion) const; virtual void drawRow(QPainter *painter, @@ -196,30 +196,30 @@ protected: const QRect &rect, const QModelIndex &index) const; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; #ifndef QT_NO_DRAGANDDROP - void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) override; #endif - bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE; + bool viewportEvent(QEvent *event) override; - void updateGeometries() Q_DECL_OVERRIDE; + void updateGeometries() override; - QSize viewportSizeHint() const Q_DECL_OVERRIDE; + QSize viewportSizeHint() const override; - int sizeHintForColumn(int column) const Q_DECL_OVERRIDE; + int sizeHintForColumn(int column) const override; int indexRowSizeHint(const QModelIndex &index) const; int rowHeight(const QModelIndex &index) const; - void horizontalScrollbarAction(int action) Q_DECL_OVERRIDE; + void horizontalScrollbarAction(int action) override; - bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool isIndexHidden(const QModelIndex &index) const override; void selectionChanged(const QItemSelection &selected, - const QItemSelection &deselected) Q_DECL_OVERRIDE; - void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; + const QItemSelection &deselected) override; + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; private: friend class ::tst_QTreeView; diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index 424ab597af..29ecf19e48 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -324,7 +324,7 @@ public: QTreeWidgetItem *itemAbove(const QTreeWidgetItem *item) const; QTreeWidgetItem *itemBelow(const QTreeWidgetItem *item) const; - void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE; + void setSelectionModel(QItemSelectionModel *selectionModel) override; public Q_SLOTS: void scrollToItem(const QTreeWidgetItem *item, @@ -346,7 +346,7 @@ Q_SIGNALS: void itemSelectionChanged(); protected: - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; virtual QStringList mimeTypes() const; #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) virtual QMimeData *mimeData(const QList &items) const; @@ -372,10 +372,10 @@ protected: protected: #if QT_CONFIG(draganddrop) - void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) override; #endif private: - void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; + void setModel(QAbstractItemModel *model) override; Q_DECLARE_PRIVATE(QTreeWidget) Q_DISABLE_COPY(QTreeWidget) diff --git a/src/widgets/itemviews/qtreewidget_p.h b/src/widgets/itemviews/qtreewidget_p.h index 7aa4daefc0..f4625842ef 100644 --- a/src/widgets/itemviews/qtreewidget_p.h +++ b/src/widgets/itemviews/qtreewidget_p.h @@ -91,24 +91,24 @@ public: void itemChanged(QTreeWidgetItem *item); QModelIndex index(const QTreeWidgetItem *item, int column) const; - QModelIndex index(int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE; - QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; - int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - bool hasChildren(const QModelIndex &parent) const Q_DECL_OVERRIDE; + QModelIndex index(int row, int column, const QModelIndex &parent) const override; + QModelIndex parent(const QModelIndex &child) const override; + int rowCount(const QModelIndex &parent) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + bool hasChildren(const QModelIndex &parent) const override; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) override; - QMap itemData(const QModelIndex &index) const Q_DECL_OVERRIDE; + QMap itemData(const QModelIndex &index) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, - int role) Q_DECL_OVERRIDE; + int role) override; - Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const override; - void sort(int column, Qt::SortOrder order) Q_DECL_OVERRIDE; + void sort(int column, Qt::SortOrder order) override; void ensureSorted(int column, Qt::SortOrder order, int start, int end, const QModelIndex &parent); static bool itemLessThan(const QPair &left, @@ -120,17 +120,17 @@ public: const QList::iterator &end, Qt::SortOrder order, QTreeWidgetItem *item); - bool insertRows(int row, int count, const QModelIndex &) Q_DECL_OVERRIDE; - bool insertColumns(int column, int count, const QModelIndex &) Q_DECL_OVERRIDE; + bool insertRows(int row, int count, const QModelIndex &) override; + bool insertColumns(int column, int count, const QModelIndex &) override; - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; // dnd - QStringList mimeTypes() const Q_DECL_OVERRIDE; - QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE; + QStringList mimeTypes() const override; + QMimeData *mimeData(const QModelIndexList &indexes) const override; bool dropMimeData(const QMimeData *data, Qt::DropAction action, - int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE; - Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE; + int row, int column, const QModelIndex &parent) override; + Qt::DropActions supportedDropActions() const override; QMimeData *internalMimeData() const; @@ -145,7 +145,7 @@ protected: void beginRemoveItems(QTreeWidgetItem *parent, int row, int count); void endRemoveItems(); void sortItems(QList *items, int column, Qt::SortOrder order); - void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *) override; private: QTreeWidgetItem *rootItem; -- cgit v1.2.3