Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#Code copied from: http://bit.ly/13yRYU4
#And later modified a bit.
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT
import sys
class MyMainWindow(QtGui.QMainWindow):
def resizeEvent(self,resizeEvent):
print self.width()
def main():
app = QtGui.QApplication(sys.argv)
mainWindow = MyMainWindow()
#Resize width and height
mainWindow.resize(300,120)
mainWindow.setWindowTitle('PyQT Detect QMainWindow Resize Event')
mainWindow.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.