Re: [PyKDE] Threading QApplications. Possible?

2004-09-20 Thread Phil Thompson
On Monday 20 September 2004 9:02 pm, Ken Godee wrote:
> >> def foo():
> >>app=QApplication(sys.argv)
> >>button=QPushButton("Hello World", None)
> >>app.setMainWidget(button)
> >>button.show()
> >>app.exec_loop()
> >>
> >> And I say
> >>
> >>  >>> thread.start_new_thread (foo, ())
> >>
> >> Then the python console freezes
> >> Is it not possible o thread up multiple QApplications?
> >> How is this achieved?
> >
> > A couple of things to note here:
> >
> > 1. The Python "threading" module is higher-level and easier to use than
> > the lower-level "thread" module.
> >
> > 2. I don't think Python and Qt threading mix well, so you should use
> > QThread and related classes rather than Python threading.
> >
> > Ciao,
> > Gordon
>
> A couple of more things.
>
> 1. See PyQt docs "Support for Threads"
>
> http://www.river-bank.demon.co.uk/docs/pyqt/PyQt.html#AEN523

Note that this section has been updated in current snapshots. If you are using 
SIP v4 then PyQt doesn't impose any additional constraints if you are using 
Python 2.4.

Phil

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Threading QApplications. Possible?

2004-09-20 Thread Ken Godee
def foo():
   app=QApplication(sys.argv)
   button=QPushButton("Hello World", None)
   app.setMainWidget(button)
   button.show()
   app.exec_loop()
And I say
 >>> thread.start_new_thread (foo, ())
Then the python console freezes
Is it not possible o thread up multiple QApplications?
How is this achieved?

A couple of things to note here:
1. The Python "threading" module is higher-level and easier to use than 
the lower-level "thread" module.

2. I don't think Python and Qt threading mix well, so you should use 
QThread and related classes rather than Python threading.

Ciao,
Gordon
A couple of more things.
1. See PyQt docs "Support for Threads"
http://www.river-bank.demon.co.uk/docs/pyqt/PyQt.html#AEN523
2. As quoted from Qt docs for QApplication()
"For any GUI application that uses Qt, there is precisely one 
QApplication object, no matter whether the application has 0, 1, 2 or 
more windows at any time."

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Another Newbie Question

2004-09-20 Thread Hihn, Jason








How do I get to get the control values of a UI-file created
dialog. I have the dialog coming up, but that is it.

 

Thanks

 







__
This electronic message may contain proprietary and confidential information of Verint Systems Inc., its affiliates and/or subsidiaries.
The information is intended to be for the use of the individual(s) or
entity(ies) named above.  If you are not the intended recipient (or authorized to receive this e-mail for the intended recipient), you may not use, copy, disclose or distribute to anyone this message or any information contained in this message.  If you have received this electronic message in error, please notify us by replying to this e-mail. (1)
___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Threading QApplications. Possible?

2004-09-20 Thread Gordon Tyler
Trost Johnson wrote:
Suppose the minimal program:
def foo():
   app=QApplication(sys.argv)
   button=QPushButton("Hello World", None)
   app.setMainWidget(button)
   button.show()
   app.exec_loop()
And I say
 >>> thread.start_new_thread (foo, ())
Then the python console freezes
Is it not possible o thread up multiple QApplications?
How is this achieved?
A couple of things to note here:
1. The Python "threading" module is higher-level and easier to use than 
the lower-level "thread" module.

2. I don't think Python and Qt threading mix well, so you should use 
QThread and related classes rather than Python threading.

Ciao,
Gordon
___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] ANN: SIP v4.1 and v3.11 Released

2004-09-20 Thread Phil Thompson
SIP v4.1 and v3.11 have been released and can be downloaded from the usual 
place.

Changes include...

- a new cast() function in the sip module
- a number of small enhancements to the C++ support
- the build system supports MSVC.NET

A new release on PyQt will follow in the next day or so.

Phil

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Threading QApplications. Possible?

2004-09-20 Thread Trost Johnson
Hi.
Suppose the minimal program:
def foo():
   app=QApplication(sys.argv)
   button=QPushButton("Hello World", None)
   app.setMainWidget(button)
   button.show()
   app.exec_loop()
And I say
>>> thread.start_new_thread (foo, ())
Then the python console freezes
Is it not possible o thread up multiple QApplications?
How is this achieved?
Thanks
___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] new pksampler version

2004-09-20 Thread Patrick Stinson
I've release a new version of pksampler and pkaudio. 
I've used povray to generate the 3d widget pixmaps, and PyQt to animate them.
Check the screen shots!

http://pksampler.sf.net/
http://pkaudio.sf.net/

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] RE: I got an error while compiling kdebinding3.3, Can I got help from you?

2004-09-20 Thread Andreas Steinmetz
I did come across the same problem. The thing is I do have old kde 
versions hanging around (at least 3.1.1 and 3.1.3). Now the python 
configure script doesn't use the current version to be built (3.3) but 
somehow manages to access one of the old versions via python.
Well, I know nothing about python, I'm just building kde. The only way 
to get around the problem for me was to move the old kde directories out 
of the way and to do soft links with the old directory names to the new 
kde installation. This way I do get past the problem.
I don't think the python configure script should work the way it does to 
detect the kde version and installation directory.
Please CC me on replies, as I'm not subscribed.
--
Andreas Steinmetz   SPAMmers use [EMAIL PROTECTED]

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Seg fault after QApplication.postEvent

2004-09-20 Thread Patrick Stinson
I'm not sure why this is happening, but I am getting a seg fault if I post a 
QCustomEvent using QApplication::postEvent() *after* 
QApplication::exec_loop() has returned. I am using a GUI, and it is fairly 
complicated. I have not been able to reproduce the error in a simpler script, 
so I guess this is just more of a simple heads up.

python-2.3.3
qt-3.3.2
sip 4.0.1 (4.0.1-224)
pyqt 3.12

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Re: Bug report: cannot open PTL files in Eric3 anymore

2004-09-20 Thread Nicola Larosa
> The fix is in the snapshot, that I just uploaded.

I confirm that the 20040918 snapshot is able to open PTL files.


-- 
Nicola Larosa - [EMAIL PROTECTED]

"You want to name all your Ogg video files '.mydickisbigger'
(even though Windows will only take the last three inches),
be my guest." -- Monty, Ogg/Vorbis/Theora developer, June 2004



pgpjvSA5D5S6r.pgp
Description: PGP signature
___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] PyQt + multiple Interpreters

2004-09-20 Thread Phil Thompson
On Monday 20 September 2004 9:20 am, Christoph Wiedemann wrote:
> > On Friday 17 September 2004 10:17 am, Christoph Wiedemann wrote:
> > > Hi Phil,
> > >
> > > > SIP v3.x is deprecated. Try v4 see what happens.
> > >
> > > i've tried (sip 4.0.1) - and there are several issues arising from the
> >
> > fact
> >
> > > that i use embedded python interpreters.
> > >
> > > 1. i've used to link my application against libqtcmodule.so, which has
> > > disappeared (renamed to qt.so). I do this in order to use
> > > sipForceConvertTo_QWidget in my embedding application.
> > >
> > > What is the recommended way to get a QWidget pointer from a PyObject *
> >
> > in
> >
> > > an embedding application with sip 4.x ?
> >
> > Call sipForceConvertTo_QWidget(). It's covered in the documentation. You
> > don't
> > need to link against anything.
>
> If i don't link against the qt extension module, i'll get an unresolved
> symbol, if i use sipForceConvertTo_QWidget in the embedding application.
> Jim Bubliz' comment might help, though.

You won't get an unresolved symbol as SIP 4 modules don't export any symbols 
(apart from the module init function). You have to #include the correct .h 
file though (which expands sipForceConvertTo_QWidget to something useful).

Phil

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] PyQt + multiple Interpreters

2004-09-20 Thread Christoph Wiedemann
> On Friday 17 September 2004 10:17 am, Christoph Wiedemann wrote:
> > Hi Phil,
> >
> > > SIP v3.x is deprecated. Try v4 see what happens.
> >
> > i've tried (sip 4.0.1) - and there are several issues arising from the
> fact
> > that i use embedded python interpreters.
> >
> > 1. i've used to link my application against libqtcmodule.so, which has
> > disappeared (renamed to qt.so). I do this in order to use
> > sipForceConvertTo_QWidget in my embedding application.
> >
> > What is the recommended way to get a QWidget pointer from a PyObject *
> in
> > an embedding application with sip 4.x ?
> 
> Call sipForceConvertTo_QWidget(). It's covered in the documentation. You
> don't 
> need to link against anything.

If i don't link against the qt extension module, i'll get an unresolved
symbol, if i use sipForceConvertTo_QWidget in the embedding application. Jim
Bubliz' comment might help, though.

> > 2. i couldn't use the new EnsureGIL methods (got a deadlock somewhere),
> so
> > i've used the -g switch while configuring PyQt.
> 
> There are bugs in Python's thread handling that are fixed in the current
> 2.4 
> alpha version and will be fixed in the next 2.3.x release. This may not be
> your problem, but it might be worth trying.

These problems were caused by the fact, that the PyGILState API expects each
thread to have exactly one PyThreadState associated with it - this wasn't
expected in PyRestoreThread API. 

> 
> > My main question still remains: Is there a way to control the
> ThreadState
> > PyQt acquires when calling virtual python functions? The situation is as
> > follows: i have two or more PyInterpreters in my application. I want to
> > provide a shell widget for each interpreter, which is most simply done
> with
> > PyCute. But when i type print "Hello", Hello pops up in incorrect places
> > (the wrong shell widget / or even in the application stdout).
> 
> I don't really understand what you are trying to do. You either have the
> right 
> thread state or the wrong one - it's not something you would want to
> control.

OK, i was slightly confused by the Python API. What i really want to do is
to control the interpreter used for the PyQt Widget (PyNewInterpreter
returns a new PyThreadState instance, so i have mixed things up). Now, i
think i've got a solution for that: I installed a C++ Event Filter for the
widget and all its children, which restores the correct interpreter for it,
i.e. set the 'interp' variable of the current ThreadState. Might not be the
most performant way, but it seems to work ...

Thanks for the help,
Christoph

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde