.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\itom\ui\demo_windowExamples.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_itom_ui_demo_windowExamples.py: Window ========= Window is a stand-alone window. The window is only hidden if the user closes it. Call show again to re-show it. It is only deleted, if the window variable is deleted. .. GENERATED FROM PYTHON SOURCE LINES 7-14 .. code-block:: default from itom import ui window = ui("mainWindow.ui", ui.TYPEWINDOW) window.show() .. GENERATED FROM PYTHON SOURCE LINES 16-18 Window_destroy is a stand-alone window, that is deleted if the user closes it, not only hidden""" .. GENERATED FROM PYTHON SOURCE LINES 18-34 .. code-block:: default def window_destroyed(): print("window_destroy destroyed") window_destroy = ui("mainWindow.ui", ui.TYPEWINDOW, deleteOnClose=True) # deleteOnClose can also be set or unset using setAttribute print("state of deleteOnClose flag:", window_destroy.getAttribute(55)) window_destroy.setAttribute(55, True) window_destroy[ "windowTitle" ] = "Self-destroyable main window" # change title of main window window_destroy.connect("destroyed()", window_destroyed) window_destroy.show() .. rst-class:: sphx-glr-script-out .. code-block:: none state of deleteOnClose flag: True .. GENERATED FROM PYTHON SOURCE LINES 35-36 Window_no_child is a stand-alone window that is no child of the main window with own symbol in the task bar .. GENERATED FROM PYTHON SOURCE LINES 36-42 .. code-block:: default window_no_child = ui("mainWindow.ui", ui.TYPEWINDOW, childOfMainWindow=False) window_no_child[ "windowTitle" ] = "Stand-alone main window" # change title of main window window_no_child.show() .. GENERATED FROM PYTHON SOURCE LINES 43-44 Widget_window is a stand-alone window obtained from a widget that was created in QtDesigner. .. GENERATED FROM PYTHON SOURCE LINES 44-47 .. code-block:: default widget_window = ui("widget.ui", ui.TYPEWINDOW) widget_window.show() .. GENERATED FROM PYTHON SOURCE LINES 48-49 Configure a window to not have a maximize button and to always stay on top. .. GENERATED FROM PYTHON SOURCE LINES 49-60 .. code-block:: default window_on_top = ui("mainWindow.ui", ui.TYPEWINDOW) window_on_top["windowTitle"] = "On-top window" # change title of main window # 0x00040000 is the flag Qt::WindowStaysOnTopHint and needs to be added if not yet done (or) # 0x00008000 is the flag Qt::WindowMaximizeButtonHint and needs to be removed if not yet done (xor) window_on_top.setWindowFlags( (window_on_top.getWindowFlags() | 0x00040000) ^ 0x00008000 ) # it is also possible to disable the close button by xor-ing Qt::WindowCloseButtonHint (0x08000000) window_on_top.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.440 seconds) .. _sphx_glr_download_11_demos_itom_ui_demo_windowExamples.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_windowExamples.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_windowExamples.ipynb `