Skip to content

Commit

Permalink
do not use deprecated QVariant::operator<
Browse files Browse the repository at this point in the history
The operator(s) are deprecated in Qt 5.15:
https://doc.qt.io/qt-5/qvariant-obsolete.html#operator-lt

This is untested and Robert might have a better way to clean this up. :-)
  • Loading branch information
v4hn committed Apr 11, 2023
1 parent 961731a commit 45349f7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion moveit_setup_assistant/src/tools/collision_linear_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,16 @@ bool SortFilterProxyModel::lessThan(const QModelIndex& src_left, const QModelInd
if (value_left == value_right)
continue;

bool smaller = (value_left < value_right);
bool smaller{};
switch (value_left.type())
{
case QVariant::Int:
smaller = value_left.toInt() < value_right.toInt();
break;
default:
smaller = value_left.toString() < value_right.toString();
break;
}
if (sort_orders_[i] == Qt::DescendingOrder)
smaller = !smaller;
return smaller;
Expand Down

0 comments on commit 45349f7

Please sign in to comment.