docs: def autoLayout(self, size):
          """
          Lays out this widget within the graphics scene.
          """
          # update the children alignment
          direction = self.property('direction', QtGui.QBoxLayout.TopToBottom)
          x = 0
          y = 0
          base_off_x = 0
          base_off_y = 0
          
          for i, child in enumerate(self.childItems()):
              off_x = 6 + child.boundingRect().width()
              off_y = 6 + child.boundingRect().height()
              
              if direction == QtGui.QBoxLayout.TopToBottom:
                  child.setPos(x, y)
                  y += off_y
              
              elif direction == QtGui.QBoxLayout.BottomToTop:
                  y -= off_y
                  child.setPos(x, y)
                  if not base_off_y:
                      base_off_y = off_y
              
              elif direction == QtGui.QBoxLayout.LeftToRight:
                  child.setPos(x, y)
                  x += off_x
                  
              else:
                  x -= off_x
                  child.setPos(x, y)
                  if not base_off_x:
                      base_off_x = off_x
          
          #----------------------------------------------------------------------
          
          pos = self.property('pos')
          align = self.property('align')
          offset = self.property('offset')
          rect = self.boundingRect()
          
          if pos:
              x = pos.x()
              y = pos.y()
          
          elif align == QtCore.Qt.AlignCenter:
              x = (size.width() - rect.width()) / 2.0
              y = (size.height() - rect.height()) / 2.0
          
          else:
              if align & QtCore.Qt.AlignLeft:
                  x = 0
              elif align & QtCore.Qt.AlignRight:
                  x = (size.width() - rect.width())
              else:
                  x = (size.width() - rect.width()) / 2.0
              
              if align & QtCore.Qt.AlignTop:
                  y = 0
              elif align & QtCore.Qt.AlignBottom:
                  y = (size.height() - rect.height())
              else:
                  y = (size.height() - rect.height()) / 2.0
          
          if offset:
              x += offset.x()
              y += offset.y()
          
          x += base_off_x
          y += base_off_y
          
          self.setPos(x, y)