Cleanup: provide our own qOverload<> implementation.

This is only in Qt 5.7 and therefore can't be used in Qt 5.5 and 5.6
builds. Moreover, we can't simply reuse Qt's version owing to
licensing concerns.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-04 22:00:38 +02:00 committed by Dirk Hohndel
parent b0e1d88634
commit 0eb00ed700
2 changed files with 23 additions and 13 deletions

View file

@ -116,6 +116,21 @@ void moveInVector(Vector &v, int rangeBegin, int rangeEnd, int destination)
std::rotate(it + destination, it + rangeBegin, it + rangeEnd);
}
// Qt overloads some signals(!) which can't therefore be used in connect() calls with
// pointers-to-member functions where the signatures of signal and slot don't match perfectly.
// For this case, Qt 5.7 provides the qOverload<> helper.
// Since we still support Qt 5.5 let's reimplement it here.
#if QT_VERSION < 0x050700
template <typename... Args>
struct QOverload {
template <typename Ret, typename Class>
static Ret (Class::*of(Ret (Class::*fun)(Args...)))(Args...)
{
return fun;
}
};
#endif
#endif
// 3) Functions visible to C and C++