[Interest] connecting to QObject member of QProcess

nus1998 nus1998 at yeah.net
Thu Sep 25 05:29:44 CEST 2014


Thanks, it works


At 2014-09-25 10:20:04, "Thiago Macieira" <thiago.macieira at intel.com> wrote:
>On Wednesday 24 September 2014 19:19:13 Thiago Macieira wrote:
>> On Thursday 25 September 2014 09:37:49 nus1998 wrote:
>> > Hi All,
>> > 
>> > I met a issue when use the new connecting method, in my code:
>> > connect(m_process,&QProcess::finished,this,&Dialog::done);
>> > which will cause a error as follow:
>> > error: no matching function for call to 'Dialog::connect(QProcess*&,
>> > <unresolved overloaded function type>, Dialog* const, void (Dialog::*)())'
>> > connect(m_process, &QProcess::finished, this, &Dialog::done); ^
>> > But the other signal such as "readyReadStandardOutput" works fine in this
>> > new connecting method. and if I change to old method as:
>> > connect(m_process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(don
>> > e
>> > ())); It works with no problem too.
>> > Anything I did wrong?
>> 
>> C++ problem. There are two functions called QProcess::finished. You need to
>> tell the compiler which one you want.
>> 
>> connect(m_process, static_cast<void (QProcess::*)()>(&QProcess::finished),
>> 	this, &Dialog::done);
>
>Make that:
>connect(m_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished), 
>        this, &Dialog::done);
>
>-- 
>Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel Open Source Technology Center
>
>_______________________________________________
>Interest mailing list
>Interest at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140925/4deecde7/attachment.html>


More information about the Interest mailing list