mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 09:03:51 -05:00
Replaced deprecated QVariant::operator< by QVariant::compare for Qt 6
This commit is contained in:
parent
79a8b3143f
commit
8d497dce0a
2 changed files with 8 additions and 0 deletions
|
|
@ -219,7 +219,11 @@ public:
|
||||||
if(left_is_not_pinned ^ right_is_not_pinned)
|
if(left_is_not_pinned ^ right_is_not_pinned)
|
||||||
return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned ; // always put pinned posts on top
|
return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned ; // always put pinned posts on top
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
return QVariant::compare(left.data(RsGxsForumModel::SortRole), right.data(RsGxsForumModel::SortRole)) < 0;
|
||||||
|
#else
|
||||||
return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ;
|
return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,11 @@ public:
|
||||||
protected:
|
protected:
|
||||||
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
|
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
return QVariant::compare(sourceModel()->data(left, RsMessageModel::SortRole), sourceModel()->data(right, RsMessageModel::SortRole)) < 0;
|
||||||
|
#else
|
||||||
return sourceModel()->data(left, RsMessageModel::SortRole) < sourceModel()->data(right, RsMessageModel::SortRole) ;
|
return sourceModel()->data(left, RsMessageModel::SortRole) < sourceModel()->data(right, RsMessageModel::SortRole) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue