Models: remove version check for clearItemData()

The version checks for clearItemData() are no longer needed now.

Change-Id: I5052188fb96cf637128662f3442d339820f0f41d
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Christian Ehrlicher 2020-05-13 21:07:22 +02:00
parent ee3994384a
commit c7ef17b231
6 changed files with 1 additions and 24 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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))

View File

@ -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;

View File

@ -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).

View File

@ -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;