E5Gui/E5MapWidget.py

changeset 5736
000ea446ff4b
parent 5389
9b1c800daff3
child 6031
ccab25598d90
equal deleted inserted replaced
5735:f606dbe20be6 5736:000ea446ff4b
7 Module implementing a base class for showing a document map. 7 Module implementing a base class for showing a document map.
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 from PyQt5.QtCore import Qt, QSize, QRect, QCoreApplication, qVersion 12 from PyQt5.QtCore import Qt, QSize, QRect, QCoreApplication
13 from PyQt5.QtGui import QColor, QBrush, QPainter 13 from PyQt5.QtGui import QColor, QBrush, QPainter
14 from PyQt5.QtWidgets import QWidget, QAbstractScrollArea 14 from PyQt5.QtWidgets import QWidget, QAbstractScrollArea
15
16 from Globals import qVersionTuple
15 17
16 18
17 class E5MapWidget(QWidget): 19 class E5MapWidget(QWidget):
18 """ 20 """
19 Class implementing a base class for showing a document map. 21 Class implementing a base class for showing a document map.
217 """ 219 """
218 Protected slot handling mouse wheel events. 220 Protected slot handling mouse wheel events.
219 221
220 @param event reference to the wheel event (QWheelEvent) 222 @param event reference to the wheel event (QWheelEvent)
221 """ 223 """
222 if qVersion() >= "5.0.0": 224 if qVersionTuple() >= (5, 0, 0):
223 isVertical = event.angleDelta().x() == 0 225 isVertical = event.angleDelta().x() == 0
224 else: 226 else:
225 isVertical = event.orientation() == Qt.Vertical 227 isVertical = event.orientation() == Qt.Vertical
226 if self._master and \ 228 if self._master and \
227 event.modifiers() == Qt.NoModifier and \ 229 event.modifiers() == Qt.NoModifier and \

eric ide

mercurial