[Interest] Using QObject in different thread as the target of Connections

Thiago Macieira thiago.macieira at intel.com
Mon May 16 22:43:51 CEST 2016


On segunda-feira, 16 de maio de 2016 18:19:37 PDT Elvis Stansvik wrote:
> Den 11 maj 2016 7:50 fm skrev "Elvis Stansvik" <elvstone at gmail.com>:
> > Hi all,
> > 
> > Setting a QML engine root context property to a QObject instance that
> > has been moved to a different thread and then attempting to connect to
> > 
> > one of its signals with Connections on the QML side seems unsupported:
> >      QQmlEngine: Illegal attempt to connect to Test(0x22b66c0) that is
> > 
> > in a different thread than the QML engine
> > 
> > I'm just wondering why this is not allowed, since on the C++ side (or
> > well, Python in my case), I can conveniently use the Qt signal/slot
> > mechanism to communicate with another thread.
> 
> Noone knows the rationale?

No, but I can guess: the QML engine binds to the QObject layers a little 
deeper than the QObject::connect() API exposes.

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




More information about the Interest mailing list