滚动条
(self, value)
| 32 | self.listWidget.itemClicked.connect(self.onItemClicked) |
| 33 | |
| 34 | def onValueChanged(self, value): |
| 35 | """滚动条""" |
| 36 | if self._blockSignals: |
| 37 | # 防止item点击时改变滚动条会触发这里 |
| 38 | return |
| 39 | for i in range(8): # 因为这里右侧有8个widget |
| 40 | widget = getattr(self, 'widget_%d' % i, None) |
| 41 | # widget不为空且在可视范围内 |
| 42 | if widget and not widget.visibleRegion().isEmpty(): |
| 43 | self.listWidget.setCurrentRow(i) # 设置item的选中 |
| 44 | return |
| 45 | |
| 46 | def onItemClicked(self, item): |
| 47 | """左侧item""" |
nothing calls this directly
no test coverage detected