From c7ef17b231a3c4c42ef26894d3869d5abab27962 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 13 May 2020 21:07:22 +0200 Subject: Models: remove version check for clearItemData() The version checks for clearItemData() are no longer needed now. Change-Id: I5052188fb96cf637128662f3442d339820f0f41d Reviewed-by: David Faure --- src/corelib/itemmodels/qstringlistmodel.cpp | 2 -- src/corelib/itemmodels/qstringlistmodel.h | 2 -- src/gui/itemmodels/qstandarditemmodel.cpp | 11 ----------- src/gui/itemmodels/qstandarditemmodel.h | 6 +----- src/sql/models/qsqltablemodel.cpp | 2 -- src/sql/models/qsqltablemodel.h | 2 -- 6 files changed, 1 insertion(+), 24 deletions(-) (limited to 'src') diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp index a950783ed8..f5f67c516f 100644 --- a/src/corelib/itemmodels/qstringlistmodel.cpp +++ b/src/corelib/itemmodels/qstringlistmodel.cpp @@ -231,7 +231,6 @@ bool QStringListModel::setData(const QModelIndex &index, const QVariant &value, return false; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) /*! \reimp \since 6.0 @@ -240,7 +239,6 @@ bool QStringListModel::clearItemData(const QModelIndex &index) { return setData(index, QVariant(), Qt::EditRole); } -#endif /*! Inserts \a count rows into the model, beginning at the given \a row. diff --git a/src/corelib/itemmodels/qstringlistmodel.h b/src/corelib/itemmodels/qstringlistmodel.h index 86725ea80b..fb53c19f09 100644 --- a/src/corelib/itemmodels/qstringlistmodel.h +++ b/src/corelib/itemmodels/qstringlistmodel.h @@ -59,9 +59,7 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool clearItemData(const QModelIndex &index) override; -#endif Qt::ItemFlags flags(const QModelIndex &index) const override; diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 9bb9d57c4e..182208e2cf 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -2994,20 +2994,9 @@ bool QStandardItemModel::setData(const QModelIndex &index, const QVariant &value return true; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) /*! \reimp */ -#else -/*! - \since 5.12 - Removes the data stored in all the roles for the given \a index. - Returns \c true if \a index is valid and data was cleared, \c false - otherwise. - - \sa setData(), data() -*/ -#endif bool QStandardItemModel::clearItemData(const QModelIndex &index) { if (!checkIndex(index, CheckIndexOption::IndexIsValid)) diff --git a/src/gui/itemmodels/qstandarditemmodel.h b/src/gui/itemmodels/qstandarditemmodel.h index 405f72d519..e0b274649a 100644 --- a/src/gui/itemmodels/qstandarditemmodel.h +++ b/src/gui/itemmodels/qstandarditemmodel.h @@ -333,11 +333,7 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; - bool clearItemData(const QModelIndex &index) -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - override -#endif - ; + bool clearItemData(const QModelIndex &index) override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 12ea0f5666..30a27bada8 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -607,7 +607,6 @@ bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, in return true; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) /*! \reimp */ @@ -615,7 +614,6 @@ bool QSqlTableModel::clearItemData(const QModelIndex &index) { return setData(index, QVariant(), Qt::EditRole); } -#endif /*! This function simply calls QSqlQueryModel::setQuery(\a query). diff --git a/src/sql/models/qsqltablemodel.h b/src/sql/models/qsqltablemodel.h index 1ac8bd9b04..97692c573e 100644 --- a/src/sql/models/qsqltablemodel.h +++ b/src/sql/models/qsqltablemodel.h @@ -74,9 +74,7 @@ public: QSqlRecord record(int row) const; QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool clearItemData(const QModelIndex &index) override; -#endif QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; -- cgit v1.2.3