class_docstr: Qt widget containing a vispy Canvas.
  
  This is a convenience class that allows a vispy canvas to be embedded
  directly into a Qt application.
  All methods and properties of the Canvas are wrapped by this class.
  
  Parameters
  ----------
  parent : QWidget or None
      The Qt parent to assign to this widget.
  canvas : instance or subclass of Canvas
      The vispy Canvas to display inside this widget, or a Canvas subclass
      to instantiate using any remaining keyword arguments.
code: def __init__(self, parent=None, canvas=None, **kwargs):
      from .canvas import Canvas
  
      if canvas is None:
          canvas = Canvas
      if issubclass(canvas, Canvas):
          canvas = canvas(**kwargs)
      elif len(**kwargs) > 0:
          raise TypeError(
              "Invalid keyword arguments: %s" % list(kwargs.keys())
          )
      if not isinstance(canvas, Canvas):
          raise TypeError(
              "canvas argument must be an instance or subclass "
              "of Canvas."
          )
  
      QWidget.__init__(self, parent)
      self.layout = QGridLayout()
      self.setLayout(self.layout)
      self.layout.setContentsMargins(0, 0, 0, 0)
      self._canvas = canvas
      self.layout.addWidget(canvas.native)
      self.setSizePolicy(canvas.native.sizePolicy())
  
file_path: vispy/vispy/app/qt.py
imports: from .backends import qt_lib
label_desc: Use image node_id 1 to create a new QtCanvas object from inherited base classes: QWidget with example: obj = QtCanvas(parent, canvas)