Make the code compile with older Qt
Sadly, we can't yet use the QMetaObject::invokeMethod that takes a functor...
(cherry picked from commit fc68afeb8d74510fdbd936c9c09a65823bc530d7)