Skip to content

Commit

Permalink
modify qt5 call in ipython for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ebjordi committed Mar 19, 2020
1 parent 5e14421 commit bd902cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tardis/gui/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
' export QT_API=pyqt \n\n For more information refer to user guide.')
import sys
try:
from IPython.lib.guisupport import get_app_qt4, start_event_loop_qt4
from IPython.lib.guisupport import is_event_loop_running_qt4
from IPython.lib.guisupport import get_app_qt5, start_event_loop_qt5
from IPython.lib.guisupport import is_event_loop_running_qt5
importFailed = False
except ImportError:
importFailed = True
Expand All @@ -36,7 +36,7 @@ def show(model):
if importFailed:
app = QtWidgets.QApplication([])
else:
app = get_app_qt4()
app = get_app_qt5()

tablemodel = SimpleTableModel
win = Tardis(tablemodel)
Expand All @@ -45,13 +45,13 @@ def show(model):
if importFailed:
app.exec_()
else:
start_event_loop_qt4(app)
start_event_loop_qt5(app)

#If the IPython console is being used, this will evaluate to true.
#In that case the window created will be garbage collected unless a
#reference to it is maintained after this function exits. So the win is
#returned.
if is_event_loop_running_qt4(app):
if is_event_loop_running_qt5(app):
return win

if __name__=='__main__':
Expand Down

0 comments on commit bd902cb

Please sign in to comment.