ANSWERS:
- Just start a one-shot timer with your
QApplication
that calls the right method onAppWindows
. - Just put the code of
onResize
inAppWindows.resizeEvent
.
Example:
from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QDialog,QImage,QPixmap
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys
class AppWindow(QDialog):
def __init__(self):
QDialog.__init__(self)
# Set up the user interface from Designer.
#self.setupUi(self)
self.setupEvents()
def setupEvents(self):
print ("setting up events")
def resizeEvent(self,event):
print event
def onQApplicationStarted(self):
print 'started'
def main():
app = QtGui.QApplication(sys.argv)
myapp = AppWindow()
myapp.show()
t = QtCore.QTimer()
t.singleShot(0,myapp.onQApplicationStarted)
sys.exit(app.exec_())
if __name__ == '__main__':
main()