'Relayout the buttons.'

def __relayout(self):

    for i in reversed(range(self.layout().count())):
        self.layout().takeAt(i)
    self.__gridSlots = [_ToolGridSlot(slot.button, slot.action, (i / self.__columns), (i % self.__columns)) for (i, slot) in enumerate(self.__gridSlots)]
    for slot in self.__gridSlots:
        self.layout().addWidget(slot.button, slot.row, slot.column, (Qt.AlignLeft | Qt.AlignTop))
