Non-Reentrant method in overrided resizeEvent method problem
I write a table class which can reload items after a resize event.
But the the reloadControls() method is non-reentrant
After i resize the table to a smaller size, two reloadControls() confilcts. The controls loaded twice,
So ,how can i prevent this situation, Cos when you resize a window,resizeEvent are raised several times.
Code:
def resizeEvent(self,event):
if self.rowCount()!=0:
self.reloadControls()
def reloadControls(self):
self.clear()
if self.rowCount()==0:
for key in self.c_dict:
self.addItem( self.c_dict[key])
sample images:
after loading
http://i.imgur.com/cLD32.jpg
after enlarging the window size, items' number did not change, there is no conflict
http://i.imgur.com/yaNsv.jpg
but when i resize the window to a smaller size, items loaded twice :
http://i.imgur.com/qI7x1.jpg
Re: Non-Reentrant method in overrided resizeEvent method problem
Two resize events cannot be processed at the same time so they cannot cause conflicts, this is not a reentrancy issue. The behaviour has to be caused by something else.