PyProgress#
- class ansys.aedt.toolkits.common.ui.utils.widgets.py_progress.py_progress.PyProgress(progress=0, progress_color='#ff79c6', background_color='#151617', text_color='#FFFFFF', font_size=10, font_family='Segoe UI', width=10)[source]#
A progress bar widget.
Inherits QWidget and includes customizable elements including progress, background color, progress color, and width.
- Parameters:
Examples
>>> import sys >>> from PySide6.QtWidgets import * >>> from ansys.aedt.toolkits.common.ui.utils.widgets.py_progress.py_progress import PyProgress >>> from random import randint >>> from PySide6.QtCore import QTimer
>>> class MyApp(QMainWindow): ... def __init__(self): ... super().__init__() ... self.progress_bar = PyProgress(progress=0, ... progress_color="#21252d", ... background_color="#313131", ... width=10) ... timer = QTimer() ... timer.timeout.connect(lambda: self.progress_bar.__setattr__("progress", randint(0, 100))) ... timer.start(1000) ... self.progress_bar.show() ... sys.exit(app.exec())
>>> if __name__ == "__main__": ... app = QApplication([]) ... window = MyApp() ... sys.exit(app.exec())