Btw. to put my money where my mouth is this is my proposal for this problem. Yes, I'm assuming the format is fixed and search operations won't return -1. If that isn't the case you can add one if to range check the indices.
std::ranges::sort(vec, [](QStringView a, QStringView b)
{
int pos_a = a.lastIndexOf(' ');
int pos_b = b.lastIndexOf(' ');
int int_a = a.sliced(pos_a).toInt();
int int_b = b.sliced(pos_b).toInt();
return int_a < int_b;
});
Do you consider this unreadable? And no, this is not fully optimized either, because it does the same int conversions multiple times, but I consider something like this to be a "good enough starting point" and in-depth optimization is possible if need arises e.g. by caching the conversions or changing the data structure.
EDIT Just after posting I realized you can do the QStringView creation right in the params, so even simpler.