eric6/WebBrowser/AutoScroll/AutoScroller.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
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 """

eric ide

mercurial