PyIcon#
- class ansys.aedt.toolkits.common.ui.utils.widgets.py_icon.py_icon.PyIcon(icon_path, icon_color='#000000')[source]#
Icon widget with customizable elements.
The icon and color can be customized during initialization.
- Parameters:
Examples
>>> import sys >>> from PySide6.QtWidgets import QApplication, QVBoxLayout, QPushButton >>> from ansys.aedt.toolkits.common.ui.utils.widgets import *
>>> class Example(QWidget): >>> def __init__(self): >>> super().__init__() >>> layout = QVBoxLayout(self) >>> layout.addWidget(QPushButton("Button 1")) >>> layout.addWidget(PyIcon('path_to_icon.svg', "#FF0000")) >>> layout.addWidget(QPushButton("Button 2"))
>>> if __name__ == "__main__": >>> app = QApplication([]) >>> window = Example() >>> window.show() >>> app.exec()