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

Error: It does not make sense to draw an image when [NSGraphicsContext currentContext] is nil, causes app to fail rendering

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: Widgets: Style Sheets
    • Labels:
      None
    • Platform/s:
      macOS

      Description

      I only use Qt with the python bindings so this report will only have reproduction cases and errors reported from the bindings, sorry if this isn't good enough.

      Error

      2020-01-09 16:24:17.153 Python[46224:1790364] It does not make sense to draw an image when [NSGraphicsContext currentContext] is nil. This is a programming error. Break on void _NSWarnForDrawingImageWithNoCurrentContext(void) to debug. This will be logged only once. This may break in the future.

      Versions

      As I said I only use the python bindings for QT I do not know which version of Qt it actually showed in but I have checked a lot of versions of PySide2 and the issues comes up in and after 5.12.6. (5.12.5 is fine). It also shows up in PyQt5 5.13.2 (5.13.1 is fine) and after. I am not very well versed in things like this and my knowledge extends no further than "can use it".

      Requirements

      macOS

       

      pip install pyobjc PyCocoa

       

      Test Case

      If you run the script supplied this will happen.

      If using 5.12.5

      pip install PySide2==5.12.5

       

      No error is shown and the window is dark, the style was applied (Working.png).

      If using +5.12.6

      pip install PySide2==5.12.6

      An error is shown and the window is white, the style was not applied (Bug.png).

       

      The example images qtmodern_working.png and qtmodern_bug.png are from this repository and branch, they of course are not as simple but shows how the error would show in an "actual" application.

      sha1=94d9a641f61bf7059aae14801521356fd1422b72

      https://github.com/Jerakin/qtmodern/tree/borderless/qtmodern

      Some extra information

      I reported this first here I PYSIDE-1187

      I put it as Component: Style Sheets because it seems to crash on that, but I am not actually sure if that's the culprit.

        Attachments

        1. Bug.png
          Bug.png
          4 kB
        2. qtbug.py
          1 kB
        3. qtmodern_bug.png
          qtmodern_bug.png
          18 kB
        4. qtmodern_working.png
          qtmodern_working.png
          84 kB
        5. Working.png
          Working.png
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            jerakln Mattias Hedberg
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes