On 01/18/2011 08:13 PM, Jed Ludlow wrote: > Please forgive me if I'm raising a heretical question with this since I > understand the topic of competing Qt bindings for Python gets a little > touchy in and of itself. Nonetheless, the elephant is in the room. I > searched the archives and found only a few comments on the subject: > mat...@li.../msg18652.html" target="_new">http://www.mail-archive.com/mat...@li.../msg18652.html> > Has there been any additional discussion among the developers about > creating a formal backend for Pyside? Its actually a fairly easy to get the PyQt backend working with PySide. It would have been laughably easy if not for a couple of bugs in PySide that took awhile to track down. To get it working PySide working you need to: * Obviously replace the reference to PyQt with PySide * Remove the reference to PyQt/Pyside.Qt and Qt.qApp by replacing it with QtGui.qApp (I think this is already done in the most recent Git version) * Replace the toolbar message signal with a new style signal by: o adding 'message = QtCore.Signal(str)' to the NavigationToolbar2QT class definition o replacing: QtCore.QObject.connect(self.toolbar, QtCore.SIGNAL("message"), self.window.statusBar().showMessage) with:self.toolbar.message.connect(self.window.statusBar().showMessage) o replacing: self.emit(QtCore.SIGNAL("message"), s) with: self.message.emit(s) * Work around the PySide bug with QImage and convert the string passed from the Agg backend into a python buffer with buffer(stringBuffer) or wait for PySide to fix bug 489. * Work around a PySide bug (738) by creating functions to perform the slider.setMaxiumum/setMinimum tasks or ignore the runtime errors for now and wait for a bug fix. * I haven't bothered with the figure options editor at this point - I just commented out the references to it. It might also be a good idea to convert all the signals/slots into the new style but it seems to work just fine with only the above changes. Regards, Gerald.
Wouldn't it be possible to use a single backend compatible with both PyQt and Pyside ? Other projects (enthought, ipython, spyderlib) seem to be able to handle the issue by importing from a proxy qt module that does the right imports and handles the incompatibilities. The preferred backend is set through an environment variable. >>> Re: Backend for Pyside by Gerald Storer Mar 23, 2011; 08:33am :: Rate this Message: - Use ratings to moderate (?) I've just noticed that its possible to use an external package as a back end so I moved my changes into their own package. This is sufficient for my own use but I'm guessing others may find is useful as well (and it might speed official support). Attached is the package. (pysidempl) Regards, Gerald. -- thanks, peter butterworth
Yes. IPython certainly has what looks like a reasonable "recipe" to support PySide and PyQt4. I would much prefer this approach. Anything to keep the number of code paths down in the different backends is well worth the effort. Mike ________________________________________ From: Peter Butterworth [bu...@gm...] Sent: Sunday, March 27, 2011 1:10 PM To: matplotlib-devel Subject: Re: [matplotlib-devel] Backend for Pyside Wouldn't it be possible to use a single backend compatible with both PyQt and Pyside ? Other projects (enthought, ipython, spyderlib) seem to be able to handle the issue by importing from a proxy qt module that does the right imports and handles the incompatibilities. The preferred backend is set through an environment variable. >>> Re: Backend for Pyside by Gerald Storer Mar 23, 2011; 08:33am :: Rate this Message: - Use ratings to moderate (?) I've just noticed that its possible to use an external package as a back end so I moved my changes into their own package. This is sufficient for my own use but I'm guessing others may find is useful as well (and it might speed official support). Attached is the package. (pysidempl) Regards, Gerald. -- thanks, peter butterworth ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Matplotlib-devel mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Looking forward, supporting the Python 3 compatible PyQt API is likely the way to go. Le , Gerald Storer <gd...@mr...> a écrit : > On 28/03/2011 1:10 AM, Peter Butterworth wrote: > Wouldn't it be possible to use a single backend compatible with both > PyQt and Pyside ? > The current Qt mpl backend uses the old PyQt slots/signals API which > PySide doesn't really support (there are some macros but they don't work > 100% the same). From a quick glance at the IPython implementation it > looks like they are using the new API which means older versions (<4.5) > of PyQt won't be supported. This might be ok, I don't know. > If it isn't then, there will need to be some try...excepts around the > place or separate back ends. If you ignore the PySide bugs I had to work > around I've only changed ~4 lines in the main backend. > Pierre's formlayout is also using an obsolete method that isn't present > in PySide. I've opted to emulate it, but it would be best to change the > code to use the alternative method available in both PyQt and PySide. > formlayout also uses the old QString implementation of PyQt, PySide only > supports the new implementation where QString is transparently convert > to/from str/unicode. Setting QString = unicode seems to work though. > Gerald.
Hi, I've submitted a pull request with backend changes that (should) let all currently supported versions of PyQt work along side PySide. I've tested with PyQt 4.8.3 and PySide 1.0.0. I haven't bothered chasing down old versions of PyQt as they seem elusive. Gerald. On 29/03/2011 3:25 AM, bu...@gm... wrote: > Looking forward, supporting the Python 3 compatible PyQt API is likely > the way to go. > > Le , Gerald Storer <gd...@mr...> a écrit : > > On 28/03/2011 1:10 AM, Peter Butterworth wrote: > > > > > > Wouldn't it be possible to use a single backend compatible with both > > > > PyQt and Pyside ? > > > > > > The current Qt mpl backend uses the old PyQt slots/signals API which > PySide doesn't really support (there are some macros but they don't > work 100% the same). From a quick glance at the IPython > implementation it looks like they are using the new API which means > older versions (<4.5) of PyQt won't be supported. This might be ok, I > don't know. > > > > If it isn't then, there will need to be some try...excepts around > the place or separate back ends. If you ignore the PySide bugs I had > to work around I've only changed ~4 lines in the main backend. > > > > > > > > Pierre's formlayout is also using an obsolete method that isn't > present in PySide. I've opted to emulate it, but it would be best to > change the code to use the alternative method available in both PyQt > and PySide. formlayout also uses the old QString implementation of > PyQt, PySide only supports the new implementation where QString is > transparently convert to/from str/unicode. Setting QString = unicode > seems to work though. > > > > > > > > Gerald. > >
Hi, I was wondering if I could get a comment on this. Its been 4 weeks since I submitted the original version and it has been more or less production ready since Monday. https://github.com/matplotlib/matplotlib/pull/80 Thanks, Gerald. On 11/04/2011 4:49 PM, Gerald Storer wrote: > Hi, > I've submitted a pull request with backend changes that (should) let > all currently supported versions of PyQt work along side PySide. I've > tested with PyQt 4.8.3 and PySide 1.0.0. > > I haven't bothered chasing down old versions of PyQt as they seem > elusive. > > Gerald. > > On 29/03/2011 3:25 AM, bu...@gm... wrote: >> Looking forward, supporting the Python 3 compatible PyQt API is >> likely the way to go. >> >> Le , Gerald Storer <gd...@mr...> a écrit : >> > On 28/03/2011 1:10 AM, Peter Butterworth wrote: >> > >> > >> > Wouldn't it be possible to use a single backend compatible with both >> > >> > PyQt and Pyside ? >> > >> > >> > The current Qt mpl backend uses the old PyQt slots/signals API >> which PySide doesn't really support (there are some macros but they >> don't work 100% the same). From a quick glance at the IPython >> implementation it looks like they are using the new API which means >> older versions (<4.5) of PyQt won't be supported. This might be ok, I >> don't know. >> > >> > If it isn't then, there will need to be some try...excepts around >> the place or separate back ends. If you ignore the PySide bugs I had >> to work around I've only changed ~4 lines in the main backend. >> > >> > >> > >> > Pierre's formlayout is also using an obsolete method that isn't >> present in PySide. I've opted to emulate it, but it would be best to >> change the code to use the alternative method available in both PyQt >> and PySide. formlayout also uses the old QString implementation of >> PyQt, PySide only supports the new implementation where QString is >> transparently convert to/from str/unicode. Setting QString = unicode >> seems to work though. >> > >> > >> > >> > Gerald. >> >
Hello, This is not directly related to your patch but I would like to report here that I still have at least one issue on MacOs that prevent matplotlib to work with your pyside backend. Indeed current PySide version (1.0.2) have a bug on MacOS that seems to have been fixed recently: http://bugs.pyside.org/show_bug.cgi?id=809 But I will have to wait for next PySide release to confirm your pyside patch works on MacOs. Will test as soon as next pyside version is out and available on macports. I do not have time nor will to test with the latest current pyside head. Regards, David Le 06/05/11 03:36, Gerald Storer a écrit : > Hi, > I was wondering if I could get a comment on this. Its been 4 weeks > since I submitted the original version and it has been more or less > production ready since Monday. > > https://github.com/matplotlib/matplotlib/pull/80 > > Thanks, > Gerald. > > On 11/04/2011 4:49 PM, Gerald Storer wrote: >> Hi, >> I've submitted a pull request with backend changes that (should) let >> all currently supported versions of PyQt work along side PySide. I've >> tested with PyQt 4.8.3 and PySide 1.0.0. >> >> I haven't bothered chasing down old versions of PyQt as they seem >> elusive. >> >> Gerald. >> >> On 29/03/2011 3:25 AM, bu...@gm... wrote: >>> Looking forward, supporting the Python 3 compatible PyQt API is >>> likely the way to go. >>> >>> Le , Gerald Storer<gd...@mr...> a écrit : >>>> On 28/03/2011 1:10 AM, Peter Butterworth wrote: >>>> >>>> >>>> Wouldn't it be possible to use a single backend compatible with both >>>> >>>> PyQt and Pyside ? >>>> >>>> >>>> The current Qt mpl backend uses the old PyQt slots/signals API >>> which PySide doesn't really support (there are some macros but they >>> don't work 100% the same). From a quick glance at the IPython >>> implementation it looks like they are using the new API which means >>> older versions (<4.5) of PyQt won't be supported. This might be ok, I >>> don't know. >>>> >>>> If it isn't then, there will need to be some try...excepts around >>> the place or separate back ends. If you ignore the PySide bugs I had >>> to work around I've only changed ~4 lines in the main backend. >>>> >>>> >>>> >>>> Pierre's formlayout is also using an obsolete method that isn't >>> present in PySide. I've opted to emulate it, but it would be best to >>> change the code to use the alternative method available in both PyQt >>> and PySide. formlayout also uses the old QString implementation of >>> PyQt, PySide only supports the new implementation where QString is >>> transparently convert to/from str/unicode. Setting QString = unicode >>> seems to work though. >>>> >>>> >>>> >>>> Gerald. >>>> > > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Based on this and some other comments I've made the minimum compatible version 1.0.3. Anyone wishing to test can use the nightly builds here: http://www.pyside.org/files/nightly/ or just wait for next months release. There's also compiling the PySide source or removing the version check too. Gerald. On 6/05/2011 4:32 PM, David Trémouilles wrote: > Hello, > > This is not directly related to your patch but I would like to > report here that I still have at least one issue on MacOs > that prevent matplotlib to work with your pyside backend. > Indeed current PySide version (1.0.2) have a bug on MacOS that seems to > have been fixed recently: > http://bugs.pyside.org/show_bug.cgi?id=809 > But I will have to wait for next PySide release to > confirm your pyside patch works on MacOs. > Will test as soon as next pyside version is out and available on > macports. I do not have time nor will to test with the latest current > pyside head. > > Regards, > > David > > > > Le 06/05/11 03:36, Gerald Storer a écrit : >> Hi, >> I was wondering if I could get a comment on this. Its been 4 weeks >> since I submitted the original version and it has been more or less >> production ready since Monday. >> >> https://github.com/matplotlib/matplotlib/pull/80 >> >> Thanks, >> Gerald. >> >> On 11/04/2011 4:49 PM, Gerald Storer wrote: >>> Hi, >>> I've submitted a pull request with backend changes that (should) let >>> all currently supported versions of PyQt work along side PySide. I've >>> tested with PyQt 4.8.3 and PySide 1.0.0. >>> >>> I haven't bothered chasing down old versions of PyQt as they seem >>> elusive. >>> >>> Gerald. >>> >>> On 29/03/2011 3:25 AM, bu...@gm... wrote: >>>> Looking forward, supporting the Python 3 compatible PyQt API is >>>> likely the way to go. >>>> >>>> Le , Gerald Storer<gd...@mr...> a écrit : >>>>> On 28/03/2011 1:10 AM, Peter Butterworth wrote: >>>>> >>>>> >>>>> Wouldn't it be possible to use a single backend compatible with both >>>>> >>>>> PyQt and Pyside ? >>>>> >>>>> >>>>> The current Qt mpl backend uses the old PyQt slots/signals API >>>> which PySide doesn't really support (there are some macros but they >>>> don't work 100% the same). From a quick glance at the IPython >>>> implementation it looks like they are using the new API which means >>>> older versions (<4.5) of PyQt won't be supported. This might be ok, I >>>> don't know. >>>>> If it isn't then, there will need to be some try...excepts around >>>> the place or separate back ends. If you ignore the PySide bugs I had >>>> to work around I've only changed ~4 lines in the main backend. >>>>> >>>>> >>>>> Pierre's formlayout is also using an obsolete method that isn't >>>> present in PySide. I've opted to emulate it, but it would be best to >>>> change the code to use the alternative method available in both PyQt >>>> and PySide. formlayout also uses the old QString implementation of >>>> PyQt, PySide only supports the new implementation where QString is >>>> transparently convert to/from str/unicode. Setting QString = unicode >>>> seems to work though. >>>>> >>>>> >>>>> Gerald. >>>>> >> >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
1.0.3 packages for Windows and Ubuntu/Debian are available to test with. I'm not sure that the OS X package is ready yet. If you want to get testing with it quicker jumping up and down on their mailing list normally gets them out faster. I also added an update to formlayout.py. I've merged in Pierre's latest version that validates the floats so an exception isn't thrown when a user inputs an invalid number. Gerald. On 31/05/2011 4:43 PM, David Trémouilles wrote: > The pyside bug affecting matplotlib pyside backend is now fixed > with pyside 1.0.3 > > I would be nice to have the pyside option in the next matplotlib release... > > Regards, > > David > > Le 06/05/11 10:32, David Trémouilles a écrit : >> Hello, >> >> This is not directly related to your patch but I would like to >> report here that I still have at least one issue on MacOs >> that prevent matplotlib to work with your pyside backend. >> Indeed current PySide version (1.0.2) have a bug on MacOS that seems to >> have been fixed recently: >> http://bugs.pyside.org/show_bug.cgi?id=809 >> But I will have to wait for next PySide release to >> confirm your pyside patch works on MacOs. >> Will test as soon as next pyside version is out and available on >> macports. I do not have time nor will to test with the latest current >> pyside head. >> >> Regards, >> >> David >> >> >> >> Le 06/05/11 03:36, Gerald Storer a écrit : >>> Hi, >>> I was wondering if I could get a comment on this. Its been 4 weeks >>> since I submitted the original version and it has been more or less >>> production ready since Monday. >>> >>> https://github.com/matplotlib/matplotlib/pull/80 >>> >>> Thanks, >>> Gerald. >>> >>> On 11/04/2011 4:49 PM, Gerald Storer wrote: >>>> Hi, >>>> I've submitted a pull request with backend changes that (should) let >>>> all currently supported versions of PyQt work along side PySide. I've >>>> tested with PyQt 4.8.3 and PySide 1.0.0. >>>> >>>> I haven't bothered chasing down old versions of PyQt as they seem >>>> elusive. >>>> >>>> Gerald. >>>> >>>> On 29/03/2011 3:25 AM, bu...@gm... wrote: >>>>> Looking forward, supporting the Python 3 compatible PyQt API is >>>>> likely the way to go. >>>>> >>>>> Le , Gerald Storer<gd...@mr...> a écrit : >>>>>> On 28/03/2011 1:10 AM, Peter Butterworth wrote: >>>>>> >>>>>> >>>>>> Wouldn't it be possible to use a single backend compatible with both >>>>>> >>>>>> PyQt and Pyside ? >>>>>> >>>>>> >>>>>> The current Qt mpl backend uses the old PyQt slots/signals API >>>>> which PySide doesn't really support (there are some macros but they >>>>> don't work 100% the same). From a quick glance at the IPython >>>>> implementation it looks like they are using the new API which means >>>>> older versions (<4.5) of PyQt won't be supported. This might be ok, I >>>>> don't know. >>>>>> If it isn't then, there will need to be some try...excepts around >>>>> the place or separate back ends. If you ignore the PySide bugs I had >>>>> to work around I've only changed ~4 lines in the main backend. >>>>>> >>>>>> >>>>>> Pierre's formlayout is also using an obsolete method that isn't >>>>> present in PySide. I've opted to emulate it, but it would be best to >>>>> change the code to use the alternative method available in both PyQt >>>>> and PySide. formlayout also uses the old QString implementation of >>>>> PyQt, PySide only supports the new implementation where QString is >>>>> transparently convert to/from str/unicode. Setting QString = unicode >>>>> seems to work though. >>>>>> >>>>>> >>>>>> Gerald. >>>>>>
Hi Gerald, thank you very much! I applied most of your changes to my matplotlib version 1.0.1 on Windows with Python 2.6. Together with the new package of PySide I was able to migrate a whole project of mine from PyQt to PySide with only minimal changes. The first test are very promissing. Even some bugs with missing icons in connection with py2exe are fixed now. It would be great to have these changes in the next release of matplotlib! Best regard, Lars On Tue, May 31, 2011 at 11:10 AM, Gerald Storer <gd...@mr...> wrote: > 1.0.3 packages for Windows and Ubuntu/Debian are available to test with. > > I'm not sure that the OS X package is ready yet. If you want to get > testing with it quicker jumping up and down on their mailing list > normally gets them out faster. > > I also added an update to formlayout.py. I've merged in Pierre's latest > version that validates the floats so an exception isn't thrown when a > user inputs an invalid number. > > Gerald. > > On 31/05/2011 4:43 PM, David Trémouilles wrote: >> The pyside bug affecting matplotlib pyside backend is now fixed >> with pyside 1.0.3 >> >> I would be nice to have the pyside option in the next matplotlib release... >> >> Regards, >> >> David >> >> Le 06/05/11 10:32, David Trémouilles a écrit : >>> Hello, >>> >>> This is not directly related to your patch but I would like to >>> report here that I still have at least one issue on MacOs >>> that prevent matplotlib to work with your pyside backend. >>> Indeed current PySide version (1.0.2) have a bug on MacOS that seems to >>> have been fixed recently: >>> http://bugs.pyside.org/show_bug.cgi?id=809 >>> But I will have to wait for next PySide release to >>> confirm your pyside patch works on MacOs. >>> Will test as soon as next pyside version is out and available on >>> macports. I do not have time nor will to test with the latest current >>> pyside head. >>> >>> Regards, >>> >>> David >>> >>> >>> >>> Le 06/05/11 03:36, Gerald Storer a écrit : >>>> Hi, >>>> I was wondering if I could get a comment on this. Its been 4 weeks >>>> since I submitted the original version and it has been more or less >>>> production ready since Monday. >>>> >>>> https://github.com/matplotlib/matplotlib/pull/80 >>>> >>>> Thanks, >>>> Gerald. >>>> >>>> On 11/04/2011 4:49 PM, Gerald Storer wrote: >>>>> Hi, >>>>> I've submitted a pull request with backend changes that (should) let >>>>> all currently supported versions of PyQt work along side PySide. I've >>>>> tested with PyQt 4.8.3 and PySide 1.0.0. >>>>> >>>>> I haven't bothered chasing down old versions of PyQt as they seem >>>>> elusive. >>>>> >>>>> Gerald. >>>>> >>>>> On 29/03/2011 3:25 AM, bu...@gm... wrote: >>>>>> Looking forward, supporting the Python 3 compatible PyQt API is >>>>>> likely the way to go. >>>>>> >>>>>> Le , Gerald Storer<gd...@mr...> a écrit : >>>>>>> On 28/03/2011 1:10 AM, Peter Butterworth wrote: >>>>>>> >>>>>>> >>>>>>> Wouldn't it be possible to use a single backend compatible with both >>>>>>> >>>>>>> PyQt and Pyside ? >>>>>>> >>>>>>> >>>>>>> The current Qt mpl backend uses the old PyQt slots/signals API >>>>>> which PySide doesn't really support (there are some macros but they >>>>>> don't work 100% the same). From a quick glance at the IPython >>>>>> implementation it looks like they are using the new API which means >>>>>> older versions (<4.5) of PyQt won't be supported. This might be ok, I >>>>>> don't know. >>>>>>> If it isn't then, there will need to be some try...excepts around >>>>>> the place or separate back ends. If you ignore the PySide bugs I had >>>>>> to work around I've only changed ~4 lines in the main backend. >>>>>>> >>>>>>> >>>>>>> Pierre's formlayout is also using an obsolete method that isn't >>>>>> present in PySide. I've opted to emulate it, but it would be best to >>>>>> change the code to use the alternative method available in both PyQt >>>>>> and PySide. formlayout also uses the old QString implementation of >>>>>> PyQt, PySide only supports the new implementation where QString is >>>>>> transparently convert to/from str/unicode. Setting QString = unicode >>>>>> seems to work though. >>>>>>> >>>>>>> >>>>>>> Gerald. >>>>>>> > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >
Hi, 1.0.3 packages are available for OS X. I'll be going on vacation next week and my work project using PySide will be winding down over the same period. It would be nice if the PySide changes could be pulled into master before then Thanks, Gerald. On 31/05/2011 5:10 PM, Gerald Storer wrote: > 1.0.3 packages for Windows and Ubuntu/Debian are available to test with. > > I'm not sure that the OS X package is ready yet. If you want to get > testing with it quicker jumping up and down on their mailing list > normally gets them out faster. > > I also added an update to formlayout.py. I've merged in Pierre's latest > version that validates the floats so an exception isn't thrown when a > user inputs an invalid number. > > Gerald. > > On 31/05/2011 4:43 PM, David Trémouilles wrote: >> The pyside bug affecting matplotlib pyside backend is now fixed >> with pyside 1.0.3 >> >> I would be nice to have the pyside option in the next matplotlib release... >> >> Regards, >> >> David >> >> Le 06/05/11 10:32, David Trémouilles a écrit : >>> Hello, >>> >>> This is not directly related to your patch but I would like to >>> report here that I still have at least one issue on MacOs >>> that prevent matplotlib to work with your pyside backend. >>> Indeed current PySide version (1.0.2) have a bug on MacOS that seems to >>> have been fixed recently: >>> http://bugs.pyside.org/show_bug.cgi?id=809 >>> But I will have to wait for next PySide release to >>> confirm your pyside patch works on MacOs. >>> Will test as soon as next pyside version is out and available on >>> macports. I do not have time nor will to test with the latest current >>> pyside head. >>> >>> Regards, >>> >>> David >>> >>> >>> >>> Le 06/05/11 03:36, Gerald Storer a écrit : >>>> Hi, >>>> I was wondering if I could get a comment on this. Its been 4 weeks >>>> since I submitted the original version and it has been more or less >>>> production ready since Monday. >>>> >>>> https://github.com/matplotlib/matplotlib/pull/80 >>>> >>>> Thanks, >>>> Gerald. >>>> >>>> On 11/04/2011 4:49 PM, Gerald Storer wrote: >>>>> Hi, >>>>> I've submitted a pull request with backend changes that (should) let >>>>> all currently supported versions of PyQt work along side PySide. I've >>>>> tested with PyQt 4.8.3 and PySide 1.0.0. >>>>> >>>>> I haven't bothered chasing down old versions of PyQt as they seem >>>>> elusive. >>>>> >>>>> Gerald. >>>>> >>>>> On 29/03/2011 3:25 AM, bu...@gm... wrote: >>>>>> Looking forward, supporting the Python 3 compatible PyQt API is >>>>>> likely the way to go. >>>>>> >>>>>> Le , Gerald Storer<gd...@mr...> a écrit : >>>>>>> On 28/03/2011 1:10 AM, Peter Butterworth wrote: >>>>>>> >>>>>>> >>>>>>> Wouldn't it be possible to use a single backend compatible with both >>>>>>> >>>>>>> PyQt and Pyside ? >>>>>>> >>>>>>> >>>>>>> The current Qt mpl backend uses the old PyQt slots/signals API >>>>>> which PySide doesn't really support (there are some macros but they >>>>>> don't work 100% the same). From a quick glance at the IPython >>>>>> implementation it looks like they are using the new API which means >>>>>> older versions (<4.5) of PyQt won't be supported. This might be ok, I >>>>>> don't know. >>>>>>> If it isn't then, there will need to be some try...excepts around >>>>>> the place or separate back ends. If you ignore the PySide bugs I had >>>>>> to work around I've only changed ~4 lines in the main backend. >>>>>>> >>>>>>> Pierre's formlayout is also using an obsolete method that isn't >>>>>> present in PySide. I've opted to emulate it, but it would be best to >>>>>> change the code to use the alternative method available in both PyQt >>>>>> and PySide. formlayout also uses the old QString implementation of >>>>>> PyQt, PySide only supports the new implementation where QString is >>>>>> transparently convert to/from str/unicode. Setting QString = unicode >>>>>> seems to work though. >>>>>>> >>>>>>> Gerald. >>>>>>> > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
I've added some comments and tested against PyQt4 4.7.3 -- I don't have PySide installed, so I'll just assume it works there, too. Cheers, Mike On 05/05/2011 09:36 PM, Gerald Storer wrote: > Hi, > I was wondering if I could get a comment on this. Its been 4 weeks > since I submitted the original version and it has been more or less > production ready since Monday. > > https://github.com/matplotlib/matplotlib/pull/80 > > Thanks, > Gerald. > > On 11/04/2011 4:49 PM, Gerald Storer wrote: > >> Hi, >> I've submitted a pull request with backend changes that (should) let >> all currently supported versions of PyQt work along side PySide. I've >> tested with PyQt 4.8.3 and PySide 1.0.0. >> >> I haven't bothered chasing down old versions of PyQt as they seem >> elusive. >> >> Gerald. >> >> On 29/03/2011 3:25 AM, bu...@gm... wrote: >> >>> Looking forward, supporting the Python 3 compatible PyQt API is >>> likely the way to go. >>> >>> Le , Gerald Storer<gd...@mr...> a écrit : >>> >>>> On 28/03/2011 1:10 AM, Peter Butterworth wrote: >>>> >>>> >>>> Wouldn't it be possible to use a single backend compatible with both >>>> >>>> PyQt and Pyside ? >>>> >>>> >>>> The current Qt mpl backend uses the old PyQt slots/signals API >>>> >>> which PySide doesn't really support (there are some macros but they >>> don't work 100% the same). From a quick glance at the IPython >>> implementation it looks like they are using the new API which means >>> older versions (<4.5) of PyQt won't be supported. This might be ok, I >>> don't know. >>> >>>> If it isn't then, there will need to be some try...excepts around >>>> >>> the place or separate back ends. If you ignore the PySide bugs I had >>> to work around I've only changed ~4 lines in the main backend. >>> >>>> >>>> >>>> Pierre's formlayout is also using an obsolete method that isn't >>>> >>> present in PySide. I've opted to emulate it, but it would be best to >>> change the code to use the alternative method available in both PyQt >>> and PySide. formlayout also uses the old QString implementation of >>> PyQt, PySide only supports the new implementation where QString is >>> transparently convert to/from str/unicode. Setting QString = unicode >>> seems to work though. >>> >>>> >>>> >>>> Gerald. >>>> >>>> > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA
The pyside bug affecting matplotlib pyside backend is now fixed with pyside 1.0.3 I would be nice to have the pyside option in the next matplotlib release... Regards, David Le 06/05/11 10:32, David Trémouilles a écrit : > Hello, > > This is not directly related to your patch but I would like to > report here that I still have at least one issue on MacOs > that prevent matplotlib to work with your pyside backend. > Indeed current PySide version (1.0.2) have a bug on MacOS that seems to > have been fixed recently: > http://bugs.pyside.org/show_bug.cgi?id=809 > But I will have to wait for next PySide release to > confirm your pyside patch works on MacOs. > Will test as soon as next pyside version is out and available on > macports. I do not have time nor will to test with the latest current > pyside head. > > Regards, > > David > > > > Le 06/05/11 03:36, Gerald Storer a écrit : >> Hi, >> I was wondering if I could get a comment on this. Its been 4 weeks >> since I submitted the original version and it has been more or less >> production ready since Monday. >> >> https://github.com/matplotlib/matplotlib/pull/80 >> >> Thanks, >> Gerald. >> >> On 11/04/2011 4:49 PM, Gerald Storer wrote: >>> Hi, >>> I've submitted a pull request with backend changes that (should) let >>> all currently supported versions of PyQt work along side PySide. I've >>> tested with PyQt 4.8.3 and PySide 1.0.0. >>> >>> I haven't bothered chasing down old versions of PyQt as they seem >>> elusive. >>> >>> Gerald. >>> >>> On 29/03/2011 3:25 AM, bu...@gm... wrote: >>>> Looking forward, supporting the Python 3 compatible PyQt API is >>>> likely the way to go. >>>> >>>> Le , Gerald Storer<gd...@mr...> a écrit : >>>>> On 28/03/2011 1:10 AM, Peter Butterworth wrote: >>>>> >>>>> >>>>> Wouldn't it be possible to use a single backend compatible with both >>>>> >>>>> PyQt and Pyside ? >>>>> >>>>> >>>>> The current Qt mpl backend uses the old PyQt slots/signals API >>>> which PySide doesn't really support (there are some macros but they >>>> don't work 100% the same). From a quick glance at the IPython >>>> implementation it looks like they are using the new API which means >>>> older versions (<4.5) of PyQt won't be supported. This might be ok, I >>>> don't know. >>>>> >>>>> If it isn't then, there will need to be some try...excepts around >>>> the place or separate back ends. If you ignore the PySide bugs I had >>>> to work around I've only changed ~4 lines in the main backend. >>>>> >>>>> >>>>> >>>>> Pierre's formlayout is also using an obsolete method that isn't >>>> present in PySide. I've opted to emulate it, but it would be best to >>>> change the code to use the alternative method available in both PyQt >>>> and PySide. formlayout also uses the old QString implementation of >>>> PyQt, PySide only supports the new implementation where QString is >>>> transparently convert to/from str/unicode. Setting QString = unicode >>>> seems to work though. >>>>> >>>>> >>>>> >>>>> Gerald. >>>>> >> >> >> >> ------------------------------------------------------------------------------ >> >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
It turns out that it was also trivial to get the figure options editor working with PySide. All that needed to be done was (in formlayout.py): * Replace the references to PyQt with PySide * Change: from PyQt.QtCore import (Qt, SIGNAL, SLOT, QSize, QString, pyqtSignature, pyqtProperty) to: from PySide.QtCore import (Qt, SIGNAL, SLOT, QSize, #QString, #pyqtSignature, pyqtProperty) Slot as pyqtSignature, Property as pyqtProperty) * Add the following after the import statements: # Hacks to emulate PyQt QString = str class QColorDialog(QColorDialog): @staticmethod def getRgba(color,parent): result = QColorDialog.getColor(QColor.fromRgba(color),parent,'') return result.rgba(),result.isValid() Formlayout could probably be updated so it doesn't need the hacks but I wanted to keep changes to a minimum. Gerald. On 17/03/2011 11:21 AM, Gerald Storer wrote: > On 01/18/2011 08:13 PM, Jed Ludlow wrote: > > Please forgive me if I'm raising a heretical question with this since I > > understand the topic of competing Qt bindings for Python gets a little > > touchy in and of itself. Nonetheless, the elephant is in the room. I > > searched the archives and found only a few comments on the subject: > > mat...@li.../msg18652.html" > target="_new">http://www.mail-archive.com/mat...@li.../msg18652.html> > > Has there been any additional discussion among the developers about > > creating a formal backend for Pyside? > > Its actually a fairly easy to get the PyQt backend working with > PySide. It would have been laughably easy if not for a couple of bugs > in PySide that took awhile to track down. > > To get it working PySide working you need to: > > * Obviously replace the reference to PyQt with PySide > * Remove the reference to PyQt/Pyside.Qt and Qt.qApp by replacing > it with QtGui.qApp (I think this is already done in the most > recent Git version) > * Replace the toolbar message signal with a new style signal by: > o adding 'message = QtCore.Signal(str)' to the > NavigationToolbar2QT class definition > o replacing: QtCore.QObject.connect(self.toolbar, > QtCore.SIGNAL("message"), > > self.window.statusBar().showMessage) > with:self.toolbar.message.connect(self.window.statusBar().showMessage) > o replacing: self.emit(QtCore.SIGNAL("message"), s) > with: self.message.emit(s) > * Work around the PySide bug with QImage and convert the string > passed from the Agg backend into a python buffer with > buffer(stringBuffer) or wait for PySide to fix bug 489. > * Work around a PySide bug (738) by creating functions to perform > the slider.setMaxiumum/setMinimum tasks or ignore the runtime > errors for now and wait for a bug fix. > * I haven't bothered with the figure options editor at this point > - I just commented out the references to it. > > It might also be a good idea to convert all the signals/slots into the > new style but it seems to work just fine with only the above changes. > > Regards, > Gerald.