Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up of Qt namespace breaks PySides #2318

Closed
tacaswell opened this issue Aug 20, 2013 · 8 comments
Closed

clean up of Qt namespace breaks PySides #2318

tacaswell opened this issue Aug 20, 2013 · 8 comments

Comments

@tacaswell
Copy link
Member

00aae5f breaks some of the compatibility bindings.

PySides does not export pyqtSignature or pyqtProperty so importing matplotlib fails. There may be more issues, but after those two I gave up and started to revert commits until it worked again ;)

By reverting both f7bee43 and 00aae5f I could get master to work with PySides again.

@mspacek can you take a look at this? I probably won't be able to look at this in detail until next week.

@dmcdougall
Copy link
Member

@tacaswell Am I missing something? 1f3d871 appears to not be a valid commit.

@tacaswell
Copy link
Member Author

@dmcdougall Sorry, I apparently fail at copy-paste. Updated the issue with the correct sha1 (f7bee43)

@mspacek
Copy link
Contributor

mspacek commented Aug 20, 2013

Oops, sorry about that. Unfortunately, I don't have any experience at all with PySide. To be honest, I didn't even know what pyqtSignature and pyqtProperty are for, I just stopped importing them directly into the namespace, along with everything else. A quick search seems to indicate they're some kind of a relic specific to PyQt4 that maybe shouldn't be used any more.

According to this, pyqtSignature decorators should be replaced with Slot decorators:
http://www.qtrac.eu/pyqtbook.html

QStrings are also apparently a relic of PyQt4's API 1. For API 2, they're gone, replaced with Python strings. PySide uses only API 2. So we'll have to force the use of API 2. I would guess there's already some machinery in MPL to do that:
http://qt-project.org/wiki/Differences_Between_PySide_and_PyQt

I'll try installing PySide and see if I can fix things up in master.

@dmcdougall
Copy link
Member

@mspacek Thanks. If no immediate solution can be implemented or you come across difficulties then let me know and those commits can be reverted.

@tacaswell
Copy link
Member Author

@mspacek There is also https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/qt4_compat.py which smooths over most of the differences.

This had been in the back of my head to check, but I never got to it. Sorry for not catching this before it got merged.

@tacaswell
Copy link
Member Author

As a note, reverting just those two commits breaks the menu functionality altogether.

@mspacek
Copy link
Contributor

mspacek commented Aug 21, 2013

Sorry, still haven't gotten around to it. I should be able to tomorrow though.

@mspacek
Copy link
Contributor

mspacek commented Aug 22, 2013

@tacaswell this is now fixed by #2328, and can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants