Am 21.01.2014 um 10:54 schrieb George Tasopoulos <tasopoulos.yorg...@gmail.com>:

> ...
> Does Qt have a way to check code before it's given to the compiler?
> 

In theory yes: the moc pre-processor does parse the code (but only for relevant 
classes).

But I don't think that adding "code validation" to moc would be a good idea ;)

That only leaves a runtime check, but as you say: the only thing that 
QObject::moveToThread gets to see is a pointer to a QThread - which can be any 
instance.

But *quickly* thinking about it: in theory the implementation /could/ do a 
check like:

  // did we just move "ourselves" to the thread?
  if (targetThread == this) then
    // error

No?

Cheers,
  Oliver
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to