我想在主窗口打开后延迟设置变量。我尝试使用showEvent(),但不起作用。我知道在wxPython中有wx.FutureCall方法可以在这种情况下使用:
class MyFrame(wx.Frame):
def __init__(..frame init parms.., ..your init parms..):
wx.Frame.__init__(..frame init parms..)
self.Show()
wx.FutureCall(500,self.OnLoad) #1/2 seconds from now to call OnLoad()
def OnLoad(self, ..your init parms..):
..your init code..
self.Refresh()
我的问题是:在PyQT主窗口初始化并最终显示后,我如何延迟执行一些操作?我应该怎么做呢?
class MyWindow(QtGui.QMainWindow):
def __init__(self,parent=None):
QtGui.QWidget.__init__(self,parent)
... init stuff here...
self.FutureCall(500,self.OnLoad)
def OnLoad(self,event):
... my stuff here...
感谢您的提前帮助! -Paul