(self, action)
| 170 | self.loadWidget.setVisible(started) |
| 171 | |
| 172 | def onActionTriggered(self, action): |
| 173 | # 这里要判断action=QAbstractSlider.SliderMove,可以避免窗口大小改变的问题 |
| 174 | # 同时防止多次加载同一个url |
| 175 | if action != QAbstractSlider.SliderMove or self._loadStart: |
| 176 | return |
| 177 | # 使用sliderPosition获取值可以同时满足鼠标滑动和拖动判断 |
| 178 | if self.verticalScrollBar().sliderPosition() == self.verticalScrollBar( |
| 179 | ).maximum(): |
| 180 | # 可以下一页了 |
| 181 | self._widget.load() |
| 182 | |
| 183 | def resizeEvent(self, event): |
| 184 | super(Window, self).resizeEvent(event) |