On Montag 20 Oktober 2008, Dirk Meyer wrote: > Hans Meine wrote: > > Heh - I like Qt very much, and I wonder how someone responsible for kaa's > > async stuff can find regular signal/slot mechanisms and event loops > > confusing.. ;-) > > I find the objects in qt confusing. You can over-do OO. I worked with a > C++ lib from two co-workers before. It wasn't possible to just use a > class from the ouside, I always had to inherit and one function.
In my experience, that is not true for big parts of Qt. For example, you can
build a complex GUI "from the outside", by assembling parts and setting
properties. In fact, this has even improved with Qt 4, where the designer
*enforces* this pattern and no longer supports some more entangled methods.
Also, you can choose between "nice, proper, OO-like" model classes for item
views by inheriting from abstract models, and convenience classes where you
simply instantiate existing item classes with your data.
Anyhow, that's quite off-topic here. I see what you mean and I do not want to
say Qt is all perfect (also I do not work for Trolltech ;-) ).
> > One thing that does not yet work is stopping the program; I need to kill
> > python with -9. :-(( Hope that you can fix that.
>
> I had the same problem with twisted. I have no idea what happens when
> you C-c a QT app (my non-kaa qt test app wouldn't die either).
I think that is because the other thread is still active. It reminds me of a
problem I had in the past, which I fixed by exec()uting another program not
in the thread used to deal with its I/O, but from the main thread (and then
still reading its stdout from within the thread). Does that ring a bell?
How can I check whether the kaa thread properly stops? (I know that
kaa.main.stop() is called.)
> But to
> prove my point look at your code and my requirements: I want a function
> to call from a thread to execute a callback in the mainloop. That isn't
> too hard and IMHO can happen very often. In twisted it took me five
> minutes to find callFromThread. Look again at your example code [...]
Yes, I realized already that I needed a much more complicated solution than
with twisted. But IMO that's just because of different APIs, and "execute a
callback in the [main thread's] mainloop" is not a very typical requirement
(maybe more so in a python environment, but not in C++). At least the way I
chose seemed to be quite straightforward when one knows Qt, and I think PyQt
just rocks because it actually worked on my first try (it has this "just
works" factor - after all I am accessing python properties of objects that
pass through Qt and virtual inheritance a lot).
--
Ciao, / / .o.
/--/ ..o
/ / ANS ooo
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Freevo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-devel
