title: Pyside alignment 2 items left and 1 item right
body: <pre><code>[Leftmost][Left Most]---------[Rightmost]
  </code></pre>
  
  <p>What I'm trying to achieve is to have the checkbox and label on the far left and then the button located on the far right.</p>
  
  <pre><code>import sys
  from PySide import QtGui, QtCore
  
  class ButtonGroupBox(QtGui.QWidget):
  
      def __init__(self, parent=None):
          super(ButtonGroupBox, self).__init__(parent=parent)
  
          self.layout = QtGui.QGridLayout(self)
          self.layout.setContentsMargins(0,0,0,0)
          self.layout.setVerticalSpacing(0)
          self.layout.setHorizontalSpacing(0)
  
          self.layout_header = QtGui.QGridLayout()
  
          self.header = QtGui.QLabel()
  
          self.toggle = QtGui.QCheckBox()
  
          self.title = QtGui.QLabel("great")
          self.title.setMargin(0)
  
          self.closer = QtGui.QPushButton("x")
          self.closer.setFixedWidth(30)
          self.closer.setFixedHeight(30)
  
          self.groupBox = QtGui.QGroupBox()
  
          self.layout_header.addWidget(self.toggle, 0, 0, QtCore.Qt.AlignLeft)
          self.layout_header.addWidget(self.title, 0, 1, QtCore.Qt.AlignLeft)
          self.layout_header.addWidget(self.closer, 0, 2, QtCore.Qt.AlignRight)
  
          self.layout.addLayout(self.layout_header, 0, 0)
          self.layout.addWidget(self.groupBox, 1, 0)
  
  
  class Example(QtGui.QWidget):
  
      def __init__(self):
          super(Example, self).__init__()
  
          self.initUI()
  
      def initUI(self):      
  
          # formatting
          self.resize(500, 500)
          self.setWindowTitle("Cameras")
  
          # widgets
          self.ListA = QtGui.QTreeWidget()
          self.ListB = QtGui.QTreeWidget()
          self.Button = QtGui.QPushButton()
          self.GP = ButtonGroupBox()
  
          self.mainLayout = QtGui.QGridLayout(self)
          self.mainLayout.setContentsMargins(5,5,5,5)
          self.mainLayout.addWidget(self.GP,0,0)
  
          self.setWindowTitle('QtGui.QSplitter')
          self.show()
  
  
      def onChanged(self, text):
  
          self.lbl.setText(text)
          self.lbl.adjustSize()      
  
  
  def main():
  
      app = QtGui.QApplication(sys.argv)
      ex = Example()
      sys.exit(app.exec_())
  
  
  if __name__ == '__main__':
      main()
  </code></pre>