PyComboBox#

class ansys.aedt.toolkits.common.ui.utils.widgets.py_combo_box.py_combo_box.PyComboBox(text_list, radius=5, bg_color='#FFFFFF', bg_color_hover='#FFFFFF', text_color='#000000', font_size=12)[source]#

Combo box widget with customizable elements.

Inherits QComboBox and includes customizable elements including text, radius, color, and background colors in different states.

Parameters:
text_listlist

List of options in combo box.

radiusint, optional

Radius of combo box corners. The default is 5.

bg_colorstr, optional

Background color of the combo box. The default is "#FFFFFF".

bg_color_hoverstr, optional

Background color when mouse hovers over the combo box. The default is "#FFFFFF".

text_colorstr, optional

Text color in the combo box. The default is "#000000".

font_sizeint, optional

The font size of the text on the button.

Examples

>>> import sys
>>> from PySide6.QtWidgets import *
>>> from ansys.aedt.toolkits.common.ui.utils.widgets import *
>>> class MyApp(QMainWindow):
...     def __init__(self):
...         super().__init__()
...         self.combo_box = PyComboBox(text_list=['Option 1', 'Option 2'], radius=5)
...         self.combo_box.show()
>>> if __name__ == "__main__":
...     app = QApplication([])
...     window = MyApp()
...     sys.exit(app.exec())