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

Colin Worth jlk2144 at gmail.com
Wed May 15 20:48:51 CEST 2019


Thanks, Konstantin, that worked well (I used the template form of the ::connect call).

Giuseppe, there is a qt bug filed here: https://bugreports.qt.io/browse/QTBUG-61667 <https://bugreports.qt.io/browse/QTBUG-61667>

But the problem seems to be that MSVC 2017 does not support a new feature of C++14, and that in turn, they aren’t required to do so because the feature is not required by the C++14 standard.

That’s my impression from a bit of reading, may not be entirely correct.

Regards

From: Konstantin Shegunov <kshegunov at gmail.com <mailto:kshegunov at gmail.com>>
Subject: Re: [Interest] Connect to signal QProcess::finished on MSVC 2017
Date: May 14, 2019 at 9:55:50 PM EDT
To: jlk <jlk2144 at gmail.com <mailto:jlk2144 at gmail.com>>
Cc: Interests Qt <interest at qt-project.org <mailto:interest at qt-project.org>>


On Wed, May 15, 2019 at 4:37 AM jlk <jlk2144 at gmail.com <mailto: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);



From: Giuseppe D'Angelo <giuseppe.dangelo at kdab.com <mailto:giuseppe.dangelo at kdab.com>>
Subject: Re: [Interest] Connect to signal QProcess::finished on MSVC 2017
Date: May 15, 2019 at 2:51:48 AM EDT
To: interest at qt-project.org <mailto:interest at qt-project.org>


Hi,

Il 15/05/19 03:35, jlk ha scritto:
> 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?  I need to
> start an (asynchronous QProcess) and run a function when it finishes.

Could you please elaborate? What bug are you talking about?

Cheers,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com <mailto:giuseppe.dangelo at kdab.com> | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com <http://www.kdab.com/>
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190515/84dc1320/attachment.html>


More information about the Interest mailing list