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

QMacCocoaViewContainer::setCocoaView crashes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.2, 5.7.1
    • 5.6.0, 5.7.0
    • None
    • Mac OS X El Capitan + Xcode 7.1 + Qt 5.7
    • f75b78a92a689b90124c79e50525bbc78540c576

    Description

      As the title states QMacCocoaViewContainer crashes when setCocoaView is called.

      The code, illustrating the issue, is quite trivial:

      Unable to find source-code formatter for language: cpp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      #include <QApplication>
      #include <QMacCocoaViewContainer>
      
      #import <AppKit/AppKit.h>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          
          QMacCocoaViewContainer container(0);
          
          // Many Cocoa objects create temporary autorelease objects,
          // so create a pool to catch them.
          NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
          
          // Create the NSView, set it on the QCocoaViewContainer.
          NSView *view = [[NSView alloc] init];
          container.setCocoaView(view);
          
          
          // Release our reference, since our super class takes ownership and we
          // don't need it anymore.
          [view release];
          
          // Clean up our pool as we no longer need it.
          [pool release];
          
          container.show();
          
          return app.exec();
      }
      

      The project archive is attached.

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            mentalmushroom Pugach Yaroslav
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes