def addWidget(self, widget, align=Qt.AlignLeft, before=None):
        """
        Adds a widget to the grid edit's toolbar with the given
        alignment.
        
        :param      widget | <QtGui.QWidget>
                    align  | <QtCore.Qt.Alignment>
        """
        # self.uiToolbarLAYOUT points to a deleted C/C++ object in PySide...
        layout = self.findChild(QHBoxLayout, 'uiToolbarLAYOUT')
        
        if before is not None:
            index = None
            for i in range(layout.count()):
                if layout.itemAt(i).widget() == before:
                    index = i
                    break
            
            if index is not None:
                layout.insertWidget(index, widget)
            else:
                layout.addWidget(widget)
            
        if align == Qt.AlignLeft:
            layout.insertWidget(0, widget)
        else:
            layout.addWidget(widget)
def addWidget ( self , widget , align = Qt . AlignLeft , before = None ) : layout = self . findChild ( QHBoxLayout , 'uiToolbarLAYOUT' ) if before is not None : index = None for i in range ( layout . count ( ) ) : if layout . itemAt ( i ) . widget ( ) == before : index = i break if index is not None : layout . insertWidget ( index , widget ) else : layout . addWidget ( widget ) if align == Qt . AlignLeft : layout . insertWidget ( 0 , widget ) else : layout . addWidget ( widget )
Adds a widget to the grid edit's toolbar with the given
        alignment.
        
        :param      widget | <QtGui.QWidget>
                    align  | <QtCore.Qt.Alignment>