Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QMacCGContext:: Unsupported paint device type 4 from a shell in MacOS #66

Open
ksallee opened this issue May 18, 2021 · 0 comments
Open

Comments

@ksallee
Copy link

ksallee commented May 18, 2021

When running this code from a shell on MacOS:

        from sgtk.platform.qt5 import QtPrintSupport
        QPrinter = QtPrintSupport.QPrinter
        # Set up the printer
        printer = QPrinter(QPrinter.HighResolution)
        printer.setPaperSize(QPrinter.A4)
        printer.setResolution(300)

        # Note: this will set the format to PdfFormat.
        printer.setOutputFileName(tempfile.gettempdir() + "foo.pdf")
        # Use the system implementation rather than the one coming with Qt.
        printer.setOutputFormat(QPrinter.NativeFormat)
        painter = QtGui.QPainter()
        painter.begin(printer)
        # Some code to paint things here.
        painter.end()

It throws the following error:
QMacCGContext:: Unsupported paint device type 4

It doesn't seem to impact the output, the document works fine.

I have another setup where this is run from another app that belongs to a framework, and the error is not thrown, and I can't find the difference between the two setups.

I tried digging through the C++ code but could not find why this was thrown, although I found where:
https://code.woboq.org/qt5/qtbase/src/gui/painting/qcoregraphics.mm.html#393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant