I have a QWidget in a QMainWindow. The QWidget contains two other widgets and a gridlayout:

Qt Code:
  1. class MainWindow(QMainWindow):
  2. def __init__(self):
  3. QMainWindow.__init__(self)
  4.  
  5. self.main = MainWidget()
  6. self.CreateActions()
  7. self.CreateMenus()
  8.  
  9. self.setCentralWidget(self.main)
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. class MainWidget(QWidget):
  2. def __init__(self):
  3. QWidget.__init__(self)
  4. self.tree = TreeArea(self)
  5. self.display = DisplayArea(self)
  6.  
  7. gridLayout = QGridLayout()
  8. gridLayout.addWidget(self.tree, 0, 0)
  9. gridLayout.addWidget(self.display, 0, 1, Qt.AlignCenter)
To copy to clipboard, switch view to plain text mode 

Here is my TreeArea and DisplayArea:

Qt Code:
  1. class TreeArea(QTreeWidget):
  2. def __init__(self, parent):
  3. QTreeWidget.__init__(self, parent)
  4.  
  5. labels = QStringList()
  6. labels << "Type" << "Name" << "Node ID" << "Device Type" << \
  7. "Address Type" << "Value"
  8.  
  9. self.setHeaderLabels(labels)
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. class DisplayArea(QFrame):
  2. def __init__(self, parent):
  3. QFrame.__init__(self, parent)
  4.  
  5. self.setAcceptDrops(True)
To copy to clipboard, switch view to plain text mode 

When I run this, the TreeArea takes up the whole widget. How do I set it so that the TreeArea takes up half the widget and the DisplayArea take up the other half? Also I want it so that when I resize the main window, all the proportions stay the same.