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

NSExeption on macos, Linux works.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 5.9.4
    • QPA
    • None
    • macOS

    Description

      The following code throws an NSExeption on my mac but has no error on Linux. 
      The code is in my main method and when I comment out one of the two paragraphs everything works fine. The problem is, I don't understand why I am not getting an NSException when I only use the QQuickView part. But getting it with both the engine and view.

      {{

      QQmlApplicationEngine engine;
      engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
      if (engine.rootObjects().isEmpty())
      return -1;

      QQuickView view;
      view.setResizeMode(QQuickView::SizeRootObjectToView);
      view.setSource(QUrl("qrc:///app.qml"));
      view.show();}}

      Exception:
      {{2018-02-06 15:31:16.933 VideoWall[42635:2301468] *** Terminating app due to uncaught exception 'NSImageCacheException', reason: 'Cannot lock focus on image <NSImage 0x7f9daff18730 Size=

      {0, 0}

      Reps=(
      )>, because it is size zero.'

          • First throw call stack:
            (
            0 CoreFoundation 0x00007fff4dc9afcb __exceptionPreprocess + 171
            1 libobjc.A.dylib 0x00007fff7493cc76 objc_exception_throw + 48
            2 CoreFoundation 0x00007fff4dd2c9ed +[NSException raise:format:] + 205
            3 AppKit 0x00007fff4b3550ad -[NSImage _lockFocusOnRepresentation:rect:context:hints:flipped:] + 316
            4 AppKit 0x00007fff4b354f6a __51-[NSImage lockFocusWithRect:context:hints:flipped:]_block_invoke + 82
            5 AppKit 0x00007fff4b3188e4 -[NSImage _usingBestRepresentationForRect:context:hints:body:] + 164
            6 AppKit 0x00007fff4b354f0f -[NSImage lockFocusWithRect:context:hints:flipped:] + 162
            7 AppKit 0x00007fff4b3b92d2 -[NSImage lockFocusFlipped:] + 123
            8 AppKit 0x00007fff4b53c978 -[NSApplication _setApplicationIconImage:setDockImage:] + 272
            9 AppKit 0x00007fff4b61260f -[NSApplication _iconImage] + 71
            10 AppKit 0x00007fff4b915f06 -[NSWindowTab image] + 169
            11 AppKit 0x00007fff4b9160f6 -[NSWindowTab tabBarItem] + 219
            12 AppKit 0x00007fff4b5de840 -[NSWindow(NSWindowTabbing) _tabBarItem] + 48
            13 AppKit 0x00007fff4ba57732 -[NSWindowStackController _addSyncedTabBarItemForWindow:atIndex:] + 60
            14 AppKit 0x00007fff4ba55886 -[NSWindowStackController insertWindow:atIndex:] + 628
            15 AppKit 0x00007fff4ba555fb -[NSWindowStackController addWindow:] + 437
            16 AppKit 0x00007fff4ba5fe01 ___findControllerForIdentifier_block_invoke + 202
            17 AppKit 0x00007fff4b6122c6 -[NSApplication enumerateWindowsWithOptions:usingBlock:] + 560
            18 AppKit 0x00007fff4ba567be _findControllerForIdentifier + 1146
            19 AppKit 0x00007fff4ba5630d +[NSWindowStackController canJoinExistingStackForWindow:] + 64
            20 AppKit 0x00007fff4b323bac -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 354
            21 AppKit 0x00007fff4b3239cf -[NSWindow orderWindow:relativeTo:] + 169
            22 AppKit 0x00007fff4b3c75c1 -[NSWindow makeKeyAndOrderFront:] + 110
            23 libqcocoa.dylib 0x000000010c59a5d4 qt_plugin_instance + 49556
            24 QtGui 0x0000000109d326e9 _ZN7QWindow10setVisibleEb + 1113
            25 VideoWall 0x0000000108df228b main + 491
            26 libdyld.dylib 0x00007fff7552c115 start + 1
            27 ??? 0x0000000000000001 0x0 + 1
            )
            libc++abi.dylib: terminating with uncaught exception of type NSException
            The program has unexpectedly finished.}}

      Attachments

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

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            kurt29 Musab Kurt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes