Using QPainter in a non-GUI environment may be useful f.e. to generate PDF's on (web)servers.
However QPainter depends on QGuiApplication, which results in a runtime error:
qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display.
How could I use QPainter in a non-GUI environment (no output screen is available)?