Skip to content

tester

test(test_widget, style=Style.AyonStyleOverCSS)

Main function to run the Qt test.

Source code in client/ayon_ui_qt/tester.py
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
def test(test_widget, style: Style = Style.AyonStyleOverCSS):
    """Main function to run the Qt test."""
    app = QtWidgets.QApplication(sys.argv)

    if style == Style.CSS:
        # Set old RV dark theme for the application
        app.setStyleSheet(load_rv_stylesheet())
    elif style == Style.AyonStyle:
        app.setStyle(get_ayon_style())
    elif style == Style.AyonStyleOverCSS:
        app.setStyleSheet(load_rv_stylesheet())

    # Create and show the test widget
    widget = test_widget()

    if style == Style.AyonStyleOverCSS:
        widget.setStyle(get_ayon_style())

    widget.show()

    print("Qt widget test started. Close the window to exit.")
    return app.exec()