Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.12.0
-
None
-
Mac OS X 10.13
Description
When used as a child widget, QMacCocoaViewContainer makes program crash in debug mode (SIGABRT) printing:
ASSERT: "!topLevelWindow->handle()->isForeignWindow() && !window->handle()->isForeignWindow()" in file qcocoabackingstore.mm, line 92
The following code can be used to reproduce the issue:
#include <QtCore> #include <QtWidgets> #include <QMacCocoaViewContainer> #include <AppKit/AppKit.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow mw; QMacCocoaViewContainer *container = new QMacCocoaViewContainer(0); NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSView *view = [[NSView alloc] init]; container->setCocoaView(view); [view release]; [pool release]; mw.setCentralWidget(container); mw.show(); return app.exec(); }
Although it may not crash in release mode, major issues occur when QMacCocoaViewContainer is used for playing video with VLC player. In addition to that, it is really hard to debug a program since Xcode will not continue program execution.
See the screenshot
The sample project is here
(Jira could not attach the file as there was a missing token. Please try attaching the file again.)