Skip to content

Instantly share code, notes, and snippets.

@Palantir555
Created July 9, 2013 14:06
Show Gist options
  • Save Palantir555/5957620 to your computer and use it in GitHub Desktop.
Save Palantir555/5957620 to your computer and use it in GitHub Desktop.
#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