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

Skip to content

Commit 415bd38

Browse files
committed
Shorten comment & update link re: Qt focus policy.
1 parent e55e79b commit 415bd38

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ class FigureManagerTk(FigureManagerBase):
405405
The tk.Toolbar
406406
window : tk.Window
407407
The tk.Window
408-
409408
"""
409+
410410
def __init__(self, canvas, num, window):
411411
FigureManagerBase.__init__(self, canvas, num)
412412
self.window = window

lib/matplotlib/backends/backend_qt5.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ class FigureManagerQT(FigureManagerBase):
512512
The qt.QToolBar
513513
window : qt.QMainWindow
514514
The qt.QMainWindow
515-
516515
"""
517516

518517
def __init__(self, canvas, num):
@@ -526,13 +525,10 @@ def __init__(self, canvas, num):
526525
image = str(cbook._get_data_path('images/matplotlib.svg'))
527526
self.window.setWindowIcon(QtGui.QIcon(image))
528527

529-
# Give the keyboard focus to the figure instead of the
530-
# manager; StrongFocus accepts both tab and click to focus and
531-
# will enable the canvas to process event w/o clicking.
532-
# ClickFocus only takes the focus is the window has been
533-
# clicked
534-
# on. http://qt-project.org/doc/qt-4.8/qt.html#FocusPolicy-enum or
535-
# http://doc.qt.digia.com/qt/qt.html#FocusPolicy-enum
528+
# Give the keyboard focus to the figure instead of the manager:
529+
# StrongFocus accepts both tab and click to focus and will enable the
530+
# canvas to process event without clicking.
531+
# https://doc.qt.io/qt-5/qt.html#FocusPolicy-enum
536532
self.canvas.setFocusPolicy(QtCore.Qt.StrongFocus)
537533
self.canvas.setFocus()
538534

0 commit comments

Comments
 (0)