#NEWLINE# def reload_qt( ) : #NEWLINE# #INDENT# '\n    Reload the Qt bindings.\n\n    If the QT_API environment variable has been updated, this will load the\n    new Qt bindings given by this variable. This should be used instead of\n    the build-in ``reload`` function because the latter can in some cases\n    cause issues with the ImportDenier (which prevents users from importing\n    e.g. PySide if PyQt4 is loaded).\n    ' #NEWLINE# _import_hook . _forbidden . clear ( ) #NEWLINE# global qapp #NEWLINE# if ( qapp is not None ) : #NEWLINE# #INDENT# qapp . quit ( ) #NEWLINE# qapp = None #NEWLINE# #UNINDENT# global QtCore #NEWLINE# global QtGui #NEWLINE# if ( os . environ . get ( 'QT_API' ) == QT_API_PYQT5 ) : #NEWLINE# #INDENT# loaders = [ _load_pyqt5 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( os . environ . get ( 'QT_API' ) == QT_API_PYSIDE ) : #NEWLINE# #INDENT# loaders = [ _load_pyside , _load_pyqt4 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# loaders = [ _load_pyqt4 , _load_pyside , _load_pyqt5 ] #NEWLINE# #UNINDENT# #UNINDENT# msgs = [ ] #NEWLINE# for loader in loaders : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# loader ( ) #NEWLINE# os . environ [ 'QT_API' ] = QT_API #NEWLINE# QtCore = sys . modules [ ( __name__ + '.QtCore' ) ] #NEWLINE# QtGui = sys . modules [ ( __name__ + '.QtGui' ) ] #NEWLINE# break #NEWLINE# #UNINDENT# except ImportError as e : #NEWLINE# #INDENT# msgs . append ( str ( e ) ) #NEWLINE# pass #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise ImportError ( ( 'Could not find a suitable QT installation. Encountered the following errors: %s' % '\n' . join ( msgs ) ) ) #NEWLINE# #UNINDENT# if ( is_pyside ( ) or is_pyqt4 ( ) ) : #NEWLINE# #INDENT# patch_qcombobox ( ) #NEWLINE# #UNINDENT# if is_pyside ( ) : #NEWLINE# #INDENT# patch_loadui ( )