Skip to content

Try PySide then PyQt4 for Qt4 examples. #2221

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

Merged
merged 2 commits into from
Jul 17, 2013
Merged

Conversation

DanielO
Copy link
Contributor

@DanielO DanielO commented Jul 17, 2013

Use the correct connect method for PySide.

This should make the examples work with both PyQt4 and PySide (I can only test the later)

Note that when I tested it with PySide the animation example would update the graph but not the frame around it.

I also only tested it on OSX. I only tested it with PySide because MPL picks PySide in preference when it and PyQt4 are installed.

Use the correct connect method for PySide.

This should make the examples work with both PyQt4 and PySide (I can only test the later)
@mdboom
Copy link
Member

mdboom commented Jul 17, 2013

It's not quite true that matplotlib always prefers PySide over PyQt4. It uses first the QT_API environment variable, and then the rcParam backend.qt4. I think instead of just trying PySide and, failing that, using PyQt4, we need to hook into that logic. Otherwise it's possible that the example will use PySide and the matplotlib Qt4 backend will use PyQt4.

These should do something like

from matplotlib.backends import qt4compat
use_pyside = qt4compat.QT_API == qt4compat.QT_API_PYSIDE

and then act accordingly.

@DanielO
Copy link
Contributor Author

DanielO commented Jul 17, 2013

Ahh thanks Michael. I have updated my pull request.

@mdboom
Copy link
Member

mdboom commented Jul 17, 2013

Looks good to me. Thanks.

mdboom added a commit that referenced this pull request Jul 17, 2013
Try PySide then PyQt4 for Qt4 examples.
@mdboom mdboom merged commit 57c14f7 into matplotlib:master Jul 17, 2013
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

Successfully merging this pull request may close these issues.

2 participants