PyWindow#

class ansys.aedt.toolkits.common.ui.utils.widgets.py_window.py_window.PyWindow(parent, margin=0, spacing=2, bg_color='#2c313c', text_color='#fff', text_font="9pt 'Segoe UI'", border_radius=10, border_size=2, border_color='#343b48')[source]#

Custom window frame widget with customizable styling and drop shadow effect.

Inherits QFrame and provides a customizable window frame.

Parameters:
parentQWidget

The parent widget for this PyWindow.

marginint, optional

The margin size around the window frame. Default is 0.

spacingint, optional

The spacing between layout items. Default is 2.

bg_colorstr, optional

The background color of the window frame. Default is “#2c313c”.

text_colorstr, optional

The text color of the window frame. Default is “#fff”.

text_fontstr, optional

The font of the text in the window frame. Default is “9pt ‘Segoe UI’”.

border_radiusint, optional

The border radius of the window frame corners. Default is 10.

border_sizeint, optional

The size of the border around the window frame. Default is 2.

border_colorstr, optional

The color of the border around the window frame. Default is “#343b48”.

set_stylesheet(bg_color=None, border_radius=None, border_size=None, border_color=None, text_color=None, text_font=None)[source]#

Sets the style sheet of the PyWindow with customizable attributes.

Parameters:
bg_colorstr, optional

The background color of the window frame.

border_radiusint, optional

The border radius of the window frame corners.

border_sizeint, optional

The size of the border around the window frame.

border_colorstr, optional

The color of the border around the window frame.

text_colorstr, optional

The text color of the window frame.

text_fontstr, optional

The font of the text in the window frame.

Examples

>>> import sys
>>> from PySide6.QtWidgets import QApplication, QMainWindow
>>> from ansys.aedt.toolkits.common.ui.utils.widgets import PyWindow
>>> class MyApp(QMainWindow):
...     def __init__(self):
...         super().__init__()
...         self.window = PyWindow(self)
...         self.setCentralWidget(self.window)
...         self.show()
>>> if __name__ == "__main__":
...     app = QApplication([])
...     window = MyApp()
...     sys.exit(app.exec())