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_list
list List of options in combo box.
- radius
int,optional Radius of combo box corners. The default is
5.- bg_color
str,optional Background color of the combo box. The default is
"#FFFFFF".- bg_color_hover
str,optional Background color when mouse hovers over the combo box. The default is
"#FFFFFF".- text_color
str,optional Text color in the combo box. The default is
"#000000".- font_size
int,optional The font size of the text on the button.
- text_list
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())