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:
parent
ee3994384a
commit
c7ef17b231
@ -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.
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
|
@ -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).
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user