iblqt.tools.get_or_create_app

iblqt.tools.get_or_create_app(argv=None)[source]

Return the existing QApplication instance or create a new one.

This helper checks for an existing QApplication instance; if none exists, it creates a new instance using the provided command-line arguments.

Parameters:

argv (list of str, optional) – Command-line arguments to pass to QApplication. If None, sys.argv is used.

Returns:

The existing or newly created QApplication instance.

Return type:

QApplication