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

Skip to content

Commit 9d184ba

Browse files
committed
FIX: make sure all of the Qt backends map to the qt event loop
1 parent da39e25 commit 9d184ba

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

IPython/core/pylabtools.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,20 @@
4141
# most part it's just a reverse of the above dict, but we also need to add a
4242
# few others that map to the same GUI manually:
4343
backend2gui = dict(zip(backends.values(), backends.keys()))
44-
# Our tests expect backend2gui to just return 'qt'
45-
backend2gui['Qt4Agg'] = 'qt'
4644
# In the reverse mapping, there are a few extra valid matplotlib backends that
4745
# map to the same GUI support
4846
backend2gui["GTK"] = backend2gui["GTKCairo"] = "gtk"
4947
backend2gui["GTK3Cairo"] = "gtk3"
5048
backend2gui["GTK4Cairo"] = "gtk4"
5149
backend2gui["WX"] = "wx"
5250
backend2gui["CocoaAgg"] = "osx"
51+
# There needs to be a hysteresis here as the new QtAgg Matplotlib backend
52+
# supports either Qt5 or Qt6 and the IPython qt event loop support Qt4, Qt5,
53+
# and Qt6.
54+
backend2gui["QtAgg"] = "qt"
55+
backend2gui["Qt4Agg"] = "qt"
56+
backend2gui["Qt5Agg"] = "qt"
57+
5358
# And some backends that don't need GUI integration
5459
del backend2gui["nbAgg"]
5560
del backend2gui["agg"]

0 commit comments

Comments
 (0)