code: def update_button(self, button, widget):
          
          if not shiboken.isValid(widget):
              self.remove_widget(widget)
              return
          button.setIconSize(QtCore.QSize(self._iconw, self._iconh))
          pix = QtGui.QPixmap(widget.size())
          widget.render(pix)
          icon = QtGui.QIcon(pix)
          button.setIcon(icon)
docs: Update the icon of the button with the given widget
  
          if the widget does not is invalid, it is deleted from the tooltip automatically.
  
          :param button: the button to update
          :type button: QtGui.QAbstractButton
          :param widget: the widget to render as icon
          :type widget: QtGui.QWidget
          :returns: None
          :rtype: None
          :raises: None