[Interest] Connect to signal QProcess::finished on MSVC 2017

Konstantin Shegunov kshegunov at gmail.com
Wed May 15 03:55:50 CEST 2019


On Wed, May 15, 2019 at 4:37 AM jlk <jlk2144 at gmail.com> wrote:

> However, on MSVC 2017, I've now read about a bug (in the
> C++ standard requirements, I guess) that prevents qOverload from
> working. Could someone suggest a workaround for my case?
>

If you can't use qOverload or QOverload<...>::of(), then you have only two
other options. Static casting the signal to the exact method type, or
specifying the template parameter explicitly.
Either:
QObject::connect(process, static_cast<void (QProcess::*)(int,
QProcess::ExitStatus)>(&QProcess::finished), receiver, slot);
or
QObject::connect<void (QProcess::*)(int, QProcess::ExitStatus)>(process,
&QProcess::finished, receiver, slot);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190515/534afb92/attachment.html>


More information about the Interest mailing list