<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2>First, let me thank you for providing and
maintaining the PyQt package! As a feedback, we compiled
and installed sucessfully your package and demos</FONT></DIV>
<DIV><FONT face=Arial size=2>for the commercial Qt3.0.4 and Qt3.0.5 versions on
Win2K (the latest PyQt 3.3 and sip3.3.2 versions!).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Now my problem, which I think is a very fundamental
one, that needs to be resolved to make a PyQt
</FONT> <FONT face=Arial size=2>based, interactive</FONT></DIV>
<DIV><FONT face=Arial size=2>plotting package:</FONT></DIV>
<DIV><FONT face=Arial size=2>I am banging my head against the wall in
trying to get PyQt (or PyQwt) to allow for INTERACTIVE plotting</FONT></DIV>
<DIV><FONT face=Arial size=2>such as with the scipy.gplt (using gnuplot) or
scipy.plt (using wxWindows) packages. I want a similar API as matlab
plotting commands or
<DIV><FONT face=Arial size=2>the scipy.plt API but based on PyQt (and/or PyQwt
but the problem is at the PyQt eventloop and threading level).
</FONT></DIV>
<DIV> </DIV>All examples with PyQt (and PyQwt demos etc) assume that one
has only</FONT></DIV>
<DIV><FONT face=Arial size=2>ONE pyqt app running and, if called as a
script, block the python interpreter until the PyQt window is closed
-- or one runs each demo as a stand alone app.</FONT></DIV>
<DIV><FONT face=Arial size=2>In order to do INTERACTIVE plotting one needs to
issue plot commands from the python interpeter command line such
as:</FONT></DIV>
<DIV>
<P><FONT face=Arial size=2>>>> import qplt</FONT></P>
<P><FONT face=Arial size=2>>>> x = [0,1,2,3, 4]; y =
[0,1.5,3,1.5,0]</FONT></P>
<P><FONT face=Arial size=2>>>> fig1 = qplt.plot(x,y) #
creates a figure window with default axes and line plot with x versus y and
returns control to the interpreter</FONT></P>
<P><FONT face=Arial size=2>>>> qplt.xlabel("x-axis") # adds a
x-label to the current axes in the current figure</FONT></P>
<P><FONT face=Arial size=2>>>> qplt.ylabel("y-axis") # adds a
y-label to the current axes in the current figure</FONT></P>
<P><FONT face=Arial size=2>>>> fig2 = qplt.figure()
# creates a second figure window and all subsequent commands
(plot(), xlabel() etc.) apply to this new window</FONT></P>
<P><FONT face=Arial size=2>etc, etc</FONT></P>
<P>In order to get such functionality one needs to create a qt qApp singleton, a
figure main-window, start the eventloop in a separate thread (either
python thread or QThread) and gives control back to the interpeter to let
the user issue new commands (e.g. another figure
main-window) interactively.</P>
<P>This seems to be a simple and natural approach to interactive plotting, but I
have not found any example or idea based on pyQt that would give me a hint how
to prevent the Qt eventloop qApp.exec_loop() blocking the interpreter or
how to add new QMainWindows from the interpreter after the eventloop is already
running in a separate python thread.</P></DIV>
<DIV><FONT face=Arial size=2> So far I have managed to to </FONT><FONT
face=Arial size=2>open a pyqt figure-window from the interpreter </FONT><FONT
face=Arial size=2>by wrapping the main() with the eventloop
qApp.exec_loop() into a python thread; but then I can't open another window from
the main thread. Using the QThread class didn't help at all: the subclassed
myQThread.run() does never give control back to the interpeter if it contains
the qApp.exec_loop(), and myQThread.start() does never call myQThread.run() but
the dummy QThread.run(). It is not clear from the Qt (and PyQt) docu if it
is possible to run the main Qt eventloop in a QThread; in my experiments it
always blocked </FONT></DIV>
<DIV>any GUI.</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have tried and tried (using all possible varaints
of python threads as well as QThread ) and can't figure out how to do
it.</FONT></DIV>
<DIV><FONT face=Arial size=2>Do you have any idea how to do real *INTERACTIVE*
plotting with PyQt? Essentially all that needs to be done is to start a qApp and
qt eventloop in a separate thread and launch several figure windows
and from the python interpreter thread.</FONT></DIV>
<DIV><FONT face=Arial size=2>Since this is a fundamental problem that many
people in the scientific area </FONT><FONT face=Arial size=2>need resolved I
hope that someone on this list (or maybe someone you know) knows
alread how to do this!</FONT></DIV>
<DIV><FONT face=Arial size=2>Any pointers, ideas or sample code would be
GREAT!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>Peter Lipa</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="mailto:porl3141@hotmail.com">porl3141@hotmail.com</A></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></FONT></DIV></BODY></HTML>