[Kde-bindings] Trouble instantiating a QPainter with smoke for Qt 4
Ashley Winters
jahqueel at yahoo.com
Mon Sep 15 06:06:48 UTC 2008
--- On Sun, 9/14/08, Chris Burel <chrisburel at gmail.com> wrote:
> Whenever I try to call QPainter::begin through the smoke
> library, I
> always get this error:
> "QPainter::begin: A paint device can only be painted
> by one painter at a time."
> // Doing this works
> //painter->begin(ptr);
>
> // Doing this doesn't
> methodid = getMethod(qt_Smoke, "QPainter",
> "begin#");
> Smoke::StackItem args2[2];
> smokeCast( qt_Smoke, methodid, args2, 1, ptr,
> "QPaintDevice" );
This line smells wrong. The chances of ptr already being a QPaintDevice just seems really low, since there's almost nothing in Qt that returns a QPaintDevice-casted pointer. If it's really a QWidget, I can easily see QPainter::begin() checking for the "am I being painted?" bit at the wrong offset, and seeing it set.
Since painter->begin(ptr) doesn't have a cast in it, I don't think that would compile cleanly given a void*, would it?
- Ashley Winters
More information about the Kde-bindings
mailing list