8000 backend_qt4: make button mapping definition use Qt's constants · matplotlib/matplotlib@518b9a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 518b9a9

Browse files
committed
backend_qt4: make button mapping definition use Qt's constants
1 parent 4ea79bb commit 518b9a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matplotlib/backends/backend_qt4.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,13 @@ class FigureCanvasQT( QtGui.QWidget, FigureCanvasBase ):
122122
QtCore.Qt.Key_Alt : 'alt',
123123
QtCore.Qt.Key_Return : 'enter'
124124
}
125-
# left 1, middle 2, right 3
126-
buttond = {1:1, 2:3, 4:2}
125+
# map Qt button codes to MouseEvent's ones:
126+
buttond = {QtCore.Qt.LeftButton : 1,
127+
QtCore.Qt.MidButton : 2,
128+
QtCore.Qt.RightButton : 3,
129+
# QtCore.Qt.XButton1 : None,
130+
# QtCore.Qt.XButton2 : None,
131+
}
127132
def __init__( self, figure ):
128133
if DEBUG: print 'FigureCanvasQt: ', figure
129134
_create_qApp()

0 commit comments

Comments
 (0)
0