@amyt @richard
I think I could fix the problem with the inaccessible IPython-Console after raw.plot(block=True)
in this new Pull-Request.
@amyt
I could not resolve the problem with raw.plot(block=False)
and the âAdd Descriptionâ-dialogue though.
The modified modal-dialog-example below shows that this is a problem between Spyder and modal dialogs from Qt when the event loop is not run inside the script itself (not calling app.exec()
inside the script and letting â%gui qtâ and Spyder handle it).
%gui qt
import sys
from PyQt5.QtWidgets import QApplication, QInputDialog, QMainWindow, \
QPushButton, QVBoxLayout, QWidget
class TestWindow(QMainWindow):
def __init__(self):
super().__init__()
widget = QWidget()
layout = QVBoxLayout()
test_bt = QPushButton('Test modal dialog')
test_bt.clicked.connect(self.open_modal_dialog)
layout.addWidget(test_bt)
widget.setLayout(layout)
self.setCentralWidget(widget)
self.show()
def open_modal_dialog(self):
QInputDialog.getText(self, 'Modal Dialog', 'This is a modal dialog!')
test_win = TestWindow()
Maybe Spyder is somehow forcing the focus on the Qt-Console inside Spyder, because if you try the same from IPython outside Spyder, the IPython-console stays inaccessible as long as a modal dialog is opened.
@cbrnr @GuillaumeFavelier Do you know something of this interaction between modal dialogs and qt-console?
The MNEQtBrowser wonât be shown in the âPlotsâ-Tab since it supports only matplotlib plots.
I hope not being able to fully use raw.plot(block=False)
inside Spyder is not too much of an obstacle for your work at the moment.
No, but since Spyder is also based on PyQt/PySide, I can imagine that they might tweak things that could cause exotic issues like this. I donât use Spyder myself so I didnât really follow all the details in this thread, but this seems like it would be interesting for the Spyder devs?
Absolutely wonât be too much of an obstacle Very happy to be able to carry on with my analysis and learning MNE. Thank you for your help everyone. Itâs amazing that people are so responsive.
Not sure if you have tried this (and if this even works), but the %gui qt5
magic command is supposed to handle event loop integration: Built-in magic commands â IPython 8.3.0 documentation
We already suggested this above, and unfortunately it didnât fix all of the issues
OK, I didnât see that.