I got it working, finally!

Originally Posted by
minimoog
Set Qt::WA_PaintOnScreen in the QWidget constructor. Reimplement QPaintDevice:

aintEngine() to return a null pointer. Just like is written in documentation on Qt::WA_PaintOnScreen.
It should be working.
That's what I did at first, but it didn't work. After you said this I went back to check it out and noticed something: when overriding paintEngine() I forgot to put the trailing "const" in the declaration and definition, so instead of
QPaintEngine* paintEngine() const { return 0; }
To copy to clipboard, switch view to plain text mode
I had
QPaintEngine* paintEngine() { return 0; }
To copy to clipboard, switch view to plain text mode
which of course did nothing. So thanks!

Originally Posted by
pherthyl
Why are you using WinAPI to paint? Is there a problem with QPainter?
To be honest, I never really considered QPainter. I was trying to do this as low-level as possible to reduce the overhead introduced by Qt's painting framework. But it looks like QPainter will do exactly what I need, thanks!
Bookmarks