[Kde-bindings] QPaintDevice bitBlt() missing from SMOKE runtime
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Tue Aug 26 07:57:19 UTC 2003
On Tuesday 26 August 2003 04:54, Germain Garand wrote:
> Le Lundi 25 Août 2003 16:30, Richard Dale a écrit :
> > I don't know what the best way to implement it is - has anyone else
> > thought about this?
>
> Ok, I've got something working... see CVS.
> I've named it GlobalSpace for now.
> A bit lengthy but well...
>
> In the end, I didn't renamed q[A-Z][a-z]+ functions because it could lead
> to namespace clashes if we export them (eg. qRed vs. Qt::red)
Good stuff! I can now bitBlt() and scribble in QtRuby like this:
def slotClearArea()
# fill the off screen buffer with plain white
@_buffer.fill( white() )
# and copy it over to the window
bitBlt( self, 0, 0, @_buffer )
end
It took me a while work out why there was no QGlobalSpace stuff in the
generated smoke source - until I discovered the '--globspace' option :). I
needed a 'class QGlobalSpace;' declaration in the smokedate.cpp file before
it would compile, and I had to comment out a couple of methods that were
missing from my version of qt:
.libs/x_8.o(.text+0x10f4): In function `xcall_QGlobalSpace(short, void*,
Smoke::StackItem*)':
: undefined reference to `qInitJpegIO()'
.libs/x_8.o(.text+0x111c): In function `xcall_QGlobalSpace(short, void*,
Smoke::StackItem*)':
: undefined reference to `qInitMngIO()'
collect2: ld returned 1 exit status
I changed findMethod() (the one I like to think of as the 'DAMNIT' function
after Ashley's comment in it) in Qt.cpp to this:
#ifdef DEBUG
printf("DAMNIT on %s::%s => %d\n", c, name, meth);
#endif
if(!meth) {
meth = qt_Smoke->findMethod("QGlobalSpace", name);
}
if(!meth) {
return result;
// empty list
} else if(meth > 0) {
...
So if it doesn't find the method in the normal way, it has a look in
QGlobalSpace before giving up. There would be a problem if there was already
a method with that name in the current class because it would hide any global
ones - maybe that doesn't matter in practice.
-- Richard
More information about the Kde-bindings
mailing list