Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72481

QMacCocoaViewContainer crash on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 5.15
    • 5.12.0
    • None
    • Mac OS X 10.13
    • macOS

    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.)
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            mentalmushroom Pugach Yaroslav
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes