I think this can be simplified as `if 'QT_API' not in os.environ:`