Important: Please read the Qt Code of Conduct -

Paint device returned engine == 0, type: 3

  • Hi all, forgive my ignorance VERY new to QT. I'm trying to build an open source application (cutycapt) but with the latest libraries on windows.

    I've downloaded and installed QT Creator and have managed to debug the application which works and I'm now trying to package it up to use on another machine so trying to find all the libraries it depends on. I've got it running but getting the following error:

    QPainter::begin: Paint device returned engine == 0, type: 3
    QPainter::setRenderHint: Painter must be active to set rendering hints
    QPainter::setBrush: Painter not active
    QPainter::pen: Painter not active
    QPainter::setPen: Painter not active
    QPainter::end: Painter not active, aborted

    Like I said it works fine when debugging but when trying to run the exe from command line I'm getting the above error so I'm assuming I'm missing something. I have the QtGui4.dll which I believe is where QPainter is from but not sure where else to look now. All I'm doing to add references is copy the relevant dlls into the release folder which seemed to get past the first few problems but have reached a dead end with this.

    Any help much appreciated.

  • Well I used dependency walker to the best of my ability to identify all of the dependencies. However, when deploying to a machine without QT installed there is always an issue for which the error tells me which class has errored (qsslsocket) but that classes assembly (QTNetwork.dll) is included.

    Pasting every assembly from the QtSDK\Desktop\Qt\4.7.4\mingw\bin\ directory solves the issue so there is obviously another dependency somewhere but I'll be jiggered if I can figure out where it is. I've read all the docs I can find on resolving dependencies but short of removing them one by one I can't figure it out.

    I'm fine for now just shoving everything in there but surely there must be a better way?!

Log in to reply