.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\itom\ui\demo_gui_with_icons_from_resource.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_11_demos_itom_ui_demo_gui_with_icons_from_resource.py: GUI icons from resources =========================== Demonstration to show a ui file, that contains icons from a qrc / rcc resource file. To create the ui file, you need at first the icons and the index file qrc, that lists all the icons and gives them a unique path. This qrc file then must be compiled together with the contained icons to a rcc resource file using the rcc binary (shipped with itom). For instance, to compile the qrc file in the icons subfolder to a rcc file in this folder, navigate a command line to the icons subfolder and apply ..code-block:: bat rcc -binary myIconResource.qrc -o ../myIconResource.rcc Then, the resource file must be loaded first into itom before opening the ui. .. GENERATED FROM PYTHON SOURCE LINES 24-39 .. code-block:: Python import itom from itom import ui # load the resource file, such that the contained icons can be used in future UIs itom.registerResource("myIconResource.rcc") # load the UI (open the UI in QtDesigner to see how the icons are assigned there) gui = ui("gui_with_icons_from_resource.ui", type=ui.TYPEWINDOW) # show the UI (no functionality at all) gui.show() .. GENERATED FROM PYTHON SOURCE LINES 41-43 .. image:: ../../_static/demoGUIIconsResources_1.png :width: 50% .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.047 seconds) .. _sphx_glr_download_11_demos_itom_ui_demo_gui_with_icons_from_resource.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_gui_with_icons_from_resource.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_gui_with_icons_from_resource.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_gui_with_icons_from_resource.zip `