[Interest] Heavily Commented Example: Simple Single Frontend with Two Backends

d3fault d3faultdotxbe at gmail.com
Sun Oct 21 23:46:27 CEST 2012


On Oct 21, 2012 11:02 AM, "Bo Thorsen" <bo at fioniasoftware.dk> wrote:
>
> If you set out to correct the documentation, you should make it better,
> not go from one one-sided way of thinking to another.
>

What? Are we talking about the same thing? 99% of the time, implementing
QThread and overriding run() is not what the user wants to do... but that's
what the (currently being revised) documentation suggests. Sure it's not
completely wrong... but that method should be just barely mentioned, and
only after the better usage (moveToThread) is thoroughly explained. There
are too many people "doing it wrong" (to quote that one article).

If someone else wants to disect the example/article and put it into the
QThread docs (or just link to it from there), feel free. I am unable to
submit directly at this time :(. And it touches more topics than just
QThread, such as signals/slots and QObject parent/child relationships... so
I consider it more of an example than documentation. How would I be able to
edit the contents of /doc/index.html to put a link to it somewhere?
Something tells me I'd have to beg/convince my superiors
(*cough*ROFL*cough*).

On another note, am I missing a call (or calls) to deleteLater somewhere?
Is it safe/ok to let the gui thread run my backend objects' destructor like
that or should I call deleteLater on them just before posting QThread quit
and wait()ing on them? My backend objects are non-pointer members so I
think deleteLater would have unintended results unless I changed them to
pointers (I remember this subject being discussed a while ago on the
mailing list. delete ends up being called on non-new'd variables or
something).

d3fault
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121021/a082150e/attachment.html>


More information about the Interest mailing list