Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge 1.5 into 2x. #6187

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 17 commits into from
Mar 19, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MNT: simplify fallback Qt behavior
A check was added change the fall-back behavior if the backend was not
set to PyQt{4,5}, but mpl was being embedded in a larger Qt application.

The previous commit handles the cases where Qt bindings are already
imported earlier in the module so the check here can be removed.
  • Loading branch information
tacaswell committed Mar 17, 2016
commit f43a30df48a4df09ef331fb0978a220d321c8a59
15 changes: 6 additions & 9 deletions lib/matplotlib/backends/qt_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,12 @@
elif rcParams['backend'] == 'Qt4Agg':
QT_API = rcParams['backend.qt4']
else:
# A different backend was specified, but we still got here because a Qt
# related file was imported. This is allowed, so lets try and guess
# what we should be using.
if "PyQt4" in sys.modules or "PySide" in sys.modules:
# PyQt4 or PySide is actually used.
QT_API = rcParams['backend.qt4']
else:
# This is a fallback: PyQt5
QT_API = rcParams['backend.qt5']
# A non-Qt backend was specified, no version of the Qt
# bindings is imported, but we still got here because a Qt
# related file was imported. This is allowed, fall back to Qt5
# using which ever binding the rparams ask for.

QT_API = rcParams['backend.qt5']

# We will define an appropriate wrapper for the differing versions
# of file dialog.
Expand Down