according to the Qt specification QGraphicsScene is a viewless data model of QGraphicsItems. I have a tool which can be used in windowed and in non-windowed mode (when providing commandline arguments to it). In non windowed mode it should run as a console application (e.g. not connecting to X or so). However either I use the application as a QCoreApplication (qt5) or I set the guienabled flag (qt4) to false in QApplication my application (obviously?) crashes when trying to instantiate the QGraphicsScene object.
Any idea how to use QGraphicsScene in a console application (apart from "no, you can't")? Thanks,
If anybody is interested in it, there is a solution in Qt5. Just put this before instantiating QApplication
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With