title: How can I resize the main window depending on screen resolution using PyQt
body: <p>I have a main window with three frames.The top frame consists of the header and the bottom frame consists of the footer. I designed it using the <code>PyQt4</code> designer.The window looks fine when I run it on my laptop with a screen resolution of <code>1920*1080</code>. But when I check the same on other resolutions like <code>1600*900</code> the footer gets cut off. I wanted to know if there is a way to resize the window according to screen resolution in the runtime so that all the three frames are shown. I tried to check online if there are any solutions for this but could not find any. I tried using <code>window.setGeometry</code> and <code>window.setFixedSize</code> functions,but it did not work.</p>
  
  <p>The code for the window is:</p>
  
  <pre><code>import sys
  import os
  import threading
  import smtplib
  
  from PyQt4 import QtCore, QtGui, uic
  import sched
  import time
  
  form_class = uic.loadUiType("FirstTest.ui")[0]                 # Load the UI
  try:
      _fromUtf8 = QtCore.QString.fromUtf8
  except AttributeError:
      _fromUtf8 = lambda s: s
  
  class MyWindowClass(QtGui.QMainWindow, form_class):
      def __init__(self, parent=None):
          QtGui.QMainWindow.__init__(self, parent)        
          self.setupUi(self)        
  
  #has some code for the field values to be shown
  
  
  
  
  
  
  
  app = QtGui.QApplication(sys.argv)
  myWindow = MyWindowClass(None)
  #myWindow.setFixedSize(500,500)
  myWindow.showMaximized()
  palette = QtGui.QPalette()
  palette.setColor(QtGui.QPalette.Background,QtCore.Qt.white)
  myWindow.setPalette(palette)
  myWindow.show()
  app.exec_()
  </code></pre>