Created
July 9, 2013 14:06
-
-
Save Palantir555/5957620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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