[Interest] connecting to QObject member of QProcess

Thiago Macieira thiago.macieira at intel.com
Thu Sep 25 04:19:13 CEST 2014


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(done
> ())); 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);

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list