.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/cube_qt_trio.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_cube_qt_trio.py: Cube qt canvas on the trio loop ------------------------------- Run a wgpu example on the Qt backend, but with the trio loop. Not sure why you'd want this, but it works! Note that the other way around, e.g. runnning a glfw canvas with the Qt loop does not work so well. .. GENERATED FROM PYTHON SOURCE LINES 11-26 .. code-block:: Python import trio from rendercanvas.pyside6 import RenderCanvas from rendercanvas.trio import loop from rendercanvas.utils.cube import setup_drawing_sync RenderCanvas.select_loop(loop) canvas = RenderCanvas(title="The $backend with $loop", update_mode="continuous") draw_frame = setup_drawing_sync(canvas) canvas.request_draw(draw_frame) if __name__ == "__main__": trio.run(loop.run_async) .. _sphx_glr_download_gallery_cube_qt_trio.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: cube_qt_trio.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: cube_qt_trio.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: cube_qt_trio.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_