class_docstr: Helper to grab a series of screenshots from the current Canvas-like object.
code: def _grab_qt_screenshot(self):
      from PyQt5.QtWidgets import QApplication
      from PyQt5.QtCore import QTimer
  
      self._canvas.show()
      # Qt is going to grab from the screen so we need the window on top
      self._canvas.raise_()
      # We need to give the GUI event loop and OS time to draw everything
      time.sleep(1.5)
      QApplication.processEvents()
      QTimer.singleShot(1000, self._grab_widget_screenshot)
      time.sleep(1.5)
      QApplication.processEvents()
  
imports: from __future__ import annotations
  import os
  import time
  import shutil
  from vispy.io import imsave
  from vispy.gloo.util import _screenshot
  from vispy.scene import SceneCanvas
  from sphinx_gallery.scrapers import optipng, figure_rst
label_desc: Use image node_id 6 for calling the FrameGrabber obj's underlying member method code with example usage: obj._grab_qt_screenshot() without return types