mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
Update specialwidget.py
This commit is contained in:
parent
2131a3ba24
commit
2b3d7e3133
@ -173,22 +173,19 @@ class ScrollFlow(QWidget):
|
|||||||
self.qscrollarea.setWidgetResizable(True)
|
self.qscrollarea.setWidgetResizable(True)
|
||||||
self.qscrollarea.setWidget(self.listWidget)
|
self.qscrollarea.setWidget(self.listWidget)
|
||||||
self.qscrollarea.scrolled.connect(self.doshowlazywidget)
|
self.qscrollarea.scrolled.connect(self.doshowlazywidget)
|
||||||
|
@trypass
|
||||||
def doshowlazywidget(self,region:QRect):
|
def doshowlazywidget(self,region:QRect):
|
||||||
try:
|
for i,widget in enumerate(self.lazyitems):
|
||||||
#print(region)
|
if i in self.lazydoneidx:
|
||||||
for i,widget in enumerate(self.lazyitems):
|
continue
|
||||||
if i in self.lazydoneidx:
|
widget_rect = widget.geometry() #有可能已被delete,必须try
|
||||||
continue
|
#print(widget_rect)
|
||||||
widget_rect = widget.geometry() #有可能已被delete,必须try
|
if region.intersects(widget_rect):
|
||||||
#print(widget_rect)
|
#print(i,widget_rect)
|
||||||
if region.intersects(widget_rect):
|
self.lazydoneidx.append(i)
|
||||||
#print(i,widget_rect)
|
widget.do()
|
||||||
self.lazydoneidx.append(i)
|
QApplication.processEvents()
|
||||||
widget.do()
|
|
||||||
QApplication.processEvents()
|
|
||||||
except:
|
|
||||||
print_exc()
|
|
||||||
|
|
||||||
def refreshscroll(self):
|
def refreshscroll(self):
|
||||||
QApplication.processEvents()
|
QApplication.processEvents()
|
||||||
self.doshowlazywidget(self.geometry())
|
self.doshowlazywidget(self.geometry())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user