.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/00-basic-pyvista-examples/qt_backend.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_examples_00-basic-pyvista-examples_qt_backend.py: .. _ref_backgroundplotter: ======================== Use a PyVista Qt backend ======================== PyVista Qt is a package that extends the PyVista functionality through the usage of Qt. Qt applications operate in a separate thread than VTK, you can simultaneously have an active VTK plot and a non-blocking Python session. This example shows how to use the PyVista Qt backend to create a plotter .. GENERATED FROM PYTHON SOURCE LINES 36-42 .. code-block:: Python import pyvista as pv from ansys.tools.visualization_interface import Plotter from ansys.tools.visualization_interface.backends.pyvista import PyVistaBackend .. GENERATED FROM PYTHON SOURCE LINES 43-53 Open a pyvistaqt window ======================= .. code-block:: python cube = pv.Cube() pv_backend = PyVistaBackend(use_qt=True) pl = Plotter(backend=pv_backend) pl.plot(cube) pl.show() .. GENERATED FROM PYTHON SOURCE LINES 56-58 Parallel VTK window =================== .. GENERATED FROM PYTHON SOURCE LINES 58-65 .. code-block:: Python sphere = pv.Sphere() pl_parallel = Plotter() pl_parallel.plot(sphere) pl_parallel.show() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/00-basic-pyvista-examples/images/sphx_glr_qt_backend_001.png :alt: qt backend :srcset: /examples/00-basic-pyvista-examples/images/sphx_glr_qt_backend_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/runner/work/ansys-tools-visualization-interface/ansys-tools-visualization-interface/doc/source/examples/00-basic-pyvista-examples/images/sphx_glr_qt_backend_001.vtksz .. GENERATED FROM PYTHON SOURCE LINES 66-72 Close the pyvistaqt window ========================== .. code-block:: python pv_backend.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.482 seconds) .. _sphx_glr_download_examples_00-basic-pyvista-examples_qt_backend.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: qt_backend.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: qt_backend.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: qt_backend.zip `