Giovanni Bajo | 1 May 2008 01:49
Favicon
Gravatar

Re: Updated PyQt Release Plans

On Wed, 2008-04-30 at 22:18 +0200, Aaron Digulla wrote:
> Phil Thompson schrieb:
> 
> >> - For everything derived from QObject, connect to the dispose signal.
> >> At this time, save a stack trace and a pointer to the Python handle
> >> associated with the QObject
> >> - When the signal is emitted, make sure that the usage count of the
> >> corresponding Python object is 0, too. If it isn't, print the saved
> >> stack trace and a new one saying that the usage count between Python
> >> and C++ is out of sync.
> >>
> >> For the installation, the debug versions of the libraries should go
> >> into special directories so I can put them in the PATH (Windows) or
> >> the LD_LIBRARY_PATH (Linux) to select them when my code behaves odd.
> > 
> > I'm not sure what that gives you. I would imagine that a QObject disappearing 
> > while there is still a Python wrapper for it is quite common and legitimate. 
> > For example, if you keep a reference to a child object and the parent gets 
> > destroyed. The problem is only when you try and use that reference - but if 
> > you do then you will get an exception anyway.
> 
> I get a core dump and on Windows, I get nothing. Even if I could get a
> core file, it wouldn't tell me where the object was created.
> 
> So maybe the trick would be to declare the Python object as "invalid" as
> soon as the dispose signal was received. After that, any call to any
> method should raise an exception.

This is exactly what PyQt (or rather SIP) does, for every Python wrapper
of a PyQt object. Whenever the QObject dies, the Python object is
(Continue reading)

Catriona Johnson | 1 May 2008 02:44
Picon

pyqtSignature question

Hello
I have a signal/slot connection which I want to express with
 <at> pyqtSignature syntax but am not sure how to do it.

self.connect(self.myView.selectionModel(),
SIGNAL("currentRowChanged(QModelIndex,QModelIndex)"), self.changed)

Any help appreciated.
David Boddie | 1 May 2008 03:02
Picon
Gravatar

Re: Updated PyQt Release Plans

On Wed Apr 30 09:06:29 BST 2008, Phil Thompson wrote:

> The current snapshot has been updated for the final Qt v4.4. I need to
> finish the new support for QMetaObject.invokeMethod() and expect to release
> PyQt v4.4 in a week or two.
>
> Now would be a good time to check for any regressions...

Some new features in QtNetwork related to SSL support need to be wrapped
in %If (PyQt_OpenSSL) ... %End tests. Otherwise, it appears to work
successfully with a current build of Qt.

David
David Boddie | 1 May 2008 03:11
Picon
Gravatar

Re: Updated PyQt Release Plans

On Wed Apr 30 09:06:29 BST 2008, Phil Thompson wrote:

> ...and now would be a good time to let me know of anything else that should
> go into the release.

The QtConcurrent namespace and the QFuture* classes related to it appear to
be missing. Is that intentional?

David
B Clowers | 1 May 2008 07:53
Picon
Favicon

Embedded IPython Shell in PyQt Widget?

So far I've been successful in implementing a Python shell into a GUI window similar to the one provided by OpenAlea (http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=screenshot).  However, I'm interested in the interactive plotting provided by the pylab interface to matplotlib and a static Python Shell will not allow an interactive session.  Apparently it freezes in the GUI loop.  I've been happy with using the IPython shell as a stand alone solution but would like to embed an interactive IPython session into a PyQt Widget (e.g. an instance of QTextEdit).  I was wondering if anyone knows of an easy implementation of this feature or if it can even be done? Is there a working example somewhere the list could point me to?
It seems as though there is a simple solution for GTK but as I'm totally unfamiliar with that GUI toolkit are there any thought on how to do this for PyQt and a QTextEdit?

http://ipython.scipy.org/moin/Cookbook/EmbeddingInGTK

Thanks

Brian

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
<div>
<table cellspacing="0" cellpadding="0" border="0"><tr><td><span>So far I've been successful in implementing a Python shell into a GUI window similar to the one provided by OpenAlea (http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=screenshot).&nbsp; However, I'm interested in the interactive plotting provided by the pylab interface to matplotlib and a static Python Shell will not allow an interactive session.&nbsp; Apparently it freezes in the GUI loop.&nbsp; I've been happy with using the IPython shell as a stand alone solution but would like to embed an interactive IPython session into a PyQt Widget (e.g. an instance of QTextEdit).&nbsp; I was wondering if anyone knows of an easy implementation of this feature or if it can even 
 be done? Is there a working example somewhere the list could point me to?<br>It seems as though there is a simple solution for GTK but as I'm totally unfamiliar with
 that GUI toolkit are there any thought on how to do this for PyQt and a QTextEdit?<br><br>http://ipython.scipy.org/moin/Cookbook/EmbeddingInGTK<br><br>Thanks<br><br>Brian<br></span></td></tr></table>
<br>Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20"> Try it now.</a>
</div>
kib2 | 1 May 2008 10:21
Picon
Favicon
Gravatar

Re: Updated PyQt Release Plans

Hi,

I've build the latest version and got one problem with the 
diagramscene.py sample :

Traceback (most recent call last):
   File "diagramscene.py", line 837, in <module>
     mainWindow = MainWindow()
   File "diagramscene.py", line 363, in __init__
     self.createToolbars()
   File "diagramscene.py", line 682, in createToolbars
     QtCore.Qt.black))
   File "diagramscene.py", line 804, in createColorMenu
     action.setData(QtCore.QVariant(QtGui.QColor(color)))
SystemError: NULL result without error in PyObject_Call

Is it my fault or a bug ?
Thanks,

Christophe K.

alteo_gange | 1 May 2008 13:39
Picon
Favicon

Accented characters

Hi,

could you complete the next bit of code please?

1) File selection (the file's name is accented: ex. animé.txt)
file = QFileDialog.getOpenFileName(None, "Open"),".","All files (*.*))
2) Print file's name in a terminal
???

It seems easy... too easy...

--

-- 
alteo_gange

Phil Thompson | 1 May 2008 14:03

Re: Updated PyQt Release Plans

On Thursday 01 May 2008, Giovanni Bajo wrote:
> On Wed, 2008-04-30 at 22:18 +0200, Aaron Digulla wrote:
> > Phil Thompson schrieb:
> > >> - For everything derived from QObject, connect to the dispose signal.
> > >> At this time, save a stack trace and a pointer to the Python handle
> > >> associated with the QObject
> > >> - When the signal is emitted, make sure that the usage count of the
> > >> corresponding Python object is 0, too. If it isn't, print the saved
> > >> stack trace and a new one saying that the usage count between Python
> > >> and C++ is out of sync.
> > >>
> > >> For the installation, the debug versions of the libraries should go
> > >> into special directories so I can put them in the PATH (Windows) or
> > >> the LD_LIBRARY_PATH (Linux) to select them when my code behaves odd.
> > >
> > > I'm not sure what that gives you. I would imagine that a QObject
> > > disappearing while there is still a Python wrapper for it is quite
> > > common and legitimate. For example, if you keep a reference to a child
> > > object and the parent gets destroyed. The problem is only when you try
> > > and use that reference - but if you do then you will get an exception
> > > anyway.
> >
> > I get a core dump and on Windows, I get nothing. Even if I could get a
> > core file, it wouldn't tell me where the object was created.
> >
> > So maybe the trick would be to declare the Python object as "invalid" as
> > soon as the dispose signal was received. After that, any call to any
> > method should raise an exception.
>
> This is exactly what PyQt (or rather SIP) does, for every Python wrapper
> of a PyQt object. Whenever the QObject dies, the Python object is
> flagged as invalid, and any usage of it results in a RuntimeError;
> moreover, you can check for this invalid condition through
> sip.isdeleted().
>
> Thus, I'm not sure what you are speaking of.

I nearly gave the same reply, but realised I was wrong. The above is true only 
for QObjects created from Python because the death of the QObject is detected 
by the virtual dtor not by the destroyed() signal.

Phil
Phil Thompson | 1 May 2008 14:04

Re: Updated PyQt Release Plans

On Thursday 01 May 2008, David Boddie wrote:
> On Wed Apr 30 09:06:29 BST 2008, Phil Thompson wrote:
> > ...and now would be a good time to let me know of anything else that
> > should go into the release.
>
> The QtConcurrent namespace and the QFuture* classes related to it appear to
> be missing. Is that intentional?

Yes. Too many templates and the GIL makes the whole thing seem pretty useless.

Unless you have some ideas...

Phil
Phil Thompson | 1 May 2008 14:08

Re: pyqtSignature question

On Thursday 01 May 2008, Catriona Johnson wrote:
> Hello
> I have a signal/slot connection which I want to express with
>  <at> pyqtSignature syntax but am not sure how to do it.
>
> self.connect(self.myView.selectionModel(),
> SIGNAL("currentRowChanged(QModelIndex,QModelIndex)"), self.changed)
>
> Any help appreciated.

I don't understand the question. You don't use the signature to make the 
connection. You use it to associate a C++ signature with a Python method. 
That's not required here.

Phil

Gmane