Finally I found solution: just need to add STATIC keyword to function's declaration, e.g. for descending sort:
Header:
static bool compareSockets(ClientSocket *first, ClientSocket *second);
static bool compareSockets(ClientSocket *first, ClientSocket *second);
To copy to clipboard, switch view to plain text mode
CPP:
bool NetworkManager::compareSockets(ClientSocket *first, ClientSocket *second)
{
return first->getTransferSpeed() > second->getTransferSpeed();
}
bool NetworkManager::compareSockets(ClientSocket *first, ClientSocket *second)
{
return first->getTransferSpeed() > second->getTransferSpeed();
}
To copy to clipboard, switch view to plain text mode
Call:
qSort(clientList->begin(), clientList->end(), compareSockets);
qSort(clientList->begin(), clientList->end(), compareSockets);
To copy to clipboard, switch view to plain text mode
Bookmarks