code: def test_qt_designer():
      """Embed Canvas via Qt Designer"""
      from PyQt4 import QtGui, uic
  
      app = QtGui.QApplication.instance()
      if app is None:
          app = QtGui.QApplication([])
  
      fname = op.join(op.dirname(__file__), "qt-designer.ui")
      with warnings.catch_warnings(
          record=True
      ):  # pyqt4 deprecation warning
          WindowTemplate, TemplateBaseClass = uic.loadUiType(fname)
  
      class MainWindow(TemplateBaseClass):
          def __init__(self):
              TemplateBaseClass.__init__(self)
  
              self.ui = WindowTemplate()
              self.ui.setupUi(self)
  
      win = MainWindow()
  
      try:
          canvas = win.ui.canvas
          # test we can access properties of the internal canvas:
          canvas.central_widget.add_view()
          win.show()
          app.processEvents()
      finally:
          win.close()
  
      return win
  
imports: from os import path
  import warnings
  from vispy.testing import requires_application
label_desc: Use image node_id 1 for calling a global function with example usage: test_qt_designer() and returns: win