[Interest] QtThread
Till Oliver Knoll
till.oliver.knoll at gmail.com
Tue Jan 21 11:43:53 CET 2014
Am 21.01.2014 um 10:54 schrieb George Tasopoulos <tasopoulos.yorghos at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140121/a328b921/attachment.html>
More information about the Interest
mailing list