Open GiuseppeCiccone96 opened 2 years ago
Hi @GiuseppeCiccone96 I've never seen that kind of errors... Can you tell me the OS, qtpy version, pyqt/pyside version you are using?
Maybe it's the way the GUI is set up... macOS Monterey Version 12.1 qtpy 2.0.1 pyqt 5.15.2
this is the code:
Strangely I could not reproduce the warning (on Windows). The Qt versions are following:
qtpy 2.0.1
pyqt5 5.15.6
pyqt5-qt5 5.15.2
pyqt5-sip 12.10.1
The only change I applied to your code is deleting the line mpl.use('qtagg')
because I did not work from IPython but I don't think this would be the reason.
I'll check it later with MacBook.
Hi @GiuseppeCiccone96, Finally I found why it happens. It seems that in MacOS, recreation of Qt window is not allowed. Even in following example I got the similar warning.
from magicgui.widgets import Container, PushButton
button = PushButton()
button.show()
c = Container()
c.show()
c.append(button) # warning here!
This might be a bug in Qt, but I think I can somehow solve this problem on my side by avoiding unnecessary window creation. Thanks for the report!
Thanks a lot for the clarification :)!
Hi,
I get this warning whenever I use my magic-class built GUI - do you know where it comes from?
qt.qpa.window: <QNSWindow: 0x137414bf0; contentView=<QNSView: 0x1374147e0; QCocoaWindow(0x60000382cd10, window=QWidgetWindow(0x600002b05260, name="magicgui.QPushButtonWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug. qt.qpa.window: <QNSWindow: 0x13740fac0; contentView=<QNSView: 0x13740f6b0; QCocoaWindow(0x60000382ca50, window=QWidgetWindow(0x600002b3fc00, name="Prepare ExperimentWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug. qt.qpa.window: <QNSWindow: 0x13744cd50; contentView=<QNSView: 0x13744c860; QCocoaWindow(0x60000382cd10, window=QWidgetWindow(0x600002b07600, name="magicgui.QPushButtonWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug. qt.qpa.window: <QNSWindow: 0x114f067a0; contentView=<QNSView: 0x114f06390; QCocoaWindow(0x600003830000, window=QWidgetWindow(0x600002b2e100, name="VisualizationWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug. qt.qpa.window: <QNSWindow: 0x137457e70; contentView=<QNSView: 0x137457a60; QCocoaWindow(0x60000382cfd0, window=QWidgetWindow(0x600002b1b960, name="Further OptionsWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
thanks a lot,
Giuseppe