Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5128 > unrolled thread
| Started by | Wojtek Mamrak <tacyt1007@gmail.com> |
|---|---|
| First post | 2011-05-11 17:55 +0200 |
| Last post | 2011-05-11 17:55 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: NewBie Doubt in Python Thread Programming Wojtek Mamrak <tacyt1007@gmail.com> - 2011-05-11 17:55 +0200
| From | Wojtek Mamrak <tacyt1007@gmail.com> |
|---|---|
| Date | 2011-05-11 17:55 +0200 |
| Subject | Re: NewBie Doubt in Python Thread Programming |
| Message-ID | <mailman.1409.1305129323.9059.python-list@python.org> |
2011/5/11 Chris Angelico <rosuav@gmail.com>:
> On Thu, May 12, 2011 at 1:16 AM, Wojtek Mamrak <tacyt1007@gmail.com> wrote:
>> Is there any special reason you don't want to use QThread?
>> http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details
>
> Other than that QThread is part of QT and threading isn't, what are
> the advantages of QThread? Is it possible (safe) to manipulate QT
> objects - in this case, the button - from a thread other than the one
> that created them? (If not, that would be a good reason for using
> QThread, which will fire an event upon termination.)
>
QThread provides mechanism of signals and slots ("from" and "to" the
thread), which are used across all pyQt. Unfortunately it is not
possible to use any widget classes in the thread (direct quote from
the docs). On the other hand signals can fire methods from the main
thread (running the app'a main loop), so this is not a big deal.
The signals are:
- finished
- started
- terminated
It is possible to block the thread, make it sleep, check whether the
thread is running, and few others.
Back to top | Article view | comp.lang.python
csiph-web