code: def toggle_tbstyle(self, button):
          
          old = button.toolButtonStyle()
          if old == QtCore.Qt.ToolButtonIconOnly:
              new = QtCore.Qt.ToolButtonTextBesideIcon
          else:
              new = QtCore.Qt.ToolButtonIconOnly
          button.setToolButtonStyle(new)
docs: Toogle the ToolButtonStyle of the given button between :data:`ToolButtonIconOnly` and :data:`ToolButtonTextBesideIcon`
  
          :param button: a tool button
          :type button: :class:`QtGui.QToolButton`
          :returns: None
          :rtype: None
          :raises: None