95 @type QMouseEvent |
95 @type QMouseEvent |
96 @return flag indicating, that the event was handled |
96 @return flag indicating, that the event was handled |
97 @rtype bool |
97 @rtype bool |
98 """ |
98 """ |
99 if self.__enabled: |
99 if self.__enabled: |
100 middleButton = evt.buttons() == Qt.MiddleButton |
100 middleButton = evt.buttons() == Qt.MouseButton.MiddleButton |
101 |
101 |
102 if view: |
102 if view: |
103 # test for start |
103 # test for start |
104 if self.__view != view and middleButton: |
104 if self.__view != view and middleButton: |
105 return self.__showIndicator(view, evt.pos()) |
105 return self.__showIndicator(view, evt.pos()) |
166 @type QEvent |
166 @type QEvent |
167 @return flag indicating, that the event was handled |
167 @return flag indicating, that the event was handled |
168 @rtype bool |
168 @rtype bool |
169 """ |
169 """ |
170 if obj == self.__indicator: |
170 if obj == self.__indicator: |
171 if evt.type() == QEvent.Enter: |
171 if evt.type() == QEvent.Type.Enter: |
172 self.__scroller.stopScrolling() |
172 self.__scroller.stopScrolling() |
173 elif evt.type() in [QEvent.Wheel, QEvent.Hide, |
173 elif evt.type() in [QEvent.Type.Wheel, QEvent.Type.Hide, |
174 QEvent.MouseButtonPress]: |
174 QEvent.Type.MouseButtonPress]: |
175 self.__stopScrolling() |
175 self.__stopScrolling() |
176 |
176 |
177 return False |
177 return False |
178 |
178 |
179 def __showIndicator(self, view, pos): |
179 def __showIndicator(self, view, pos): |
231 self.__indicator.show() |
231 self.__indicator.show() |
232 |
232 |
233 self.__scroller.setPage(view.page()) |
233 self.__scroller.setPage(view.page()) |
234 |
234 |
235 self.__view.inputWidget().grabMouse() |
235 self.__view.inputWidget().grabMouse() |
236 QApplication.setOverrideCursor(Qt.ArrowCursor) |
236 QApplication.setOverrideCursor(Qt.CursorShape.ArrowCursor) |
237 |
237 |
238 return True |
238 return True |
239 |
239 |
240 def __stopScrolling(self): |
240 def __stopScrolling(self): |
241 """ |
241 """ |