[Kde-bindings] Creating QImage from Ruby string

Davor Ocelic docelic at spinlocksolutions.com
Sun Nov 9 03:53:35 UTC 2008


Hello folks,

We're trying to create QImage from raw RGB32 data (contained in a Ruby
String) using any of the following constructors:

QImage ( uchar * data, int width, int height, Format format )
QImage ( const uchar * data, int width, int height, Format format )
QImage ( uchar * data, int width, int height, int bytesPerLine, Format format )
QImage ( const uchar * data, int width, int height, int bytesPerLine, Format format )

We have resolved constructor ambiguity by preferring const uchar* over
uchar* by increasing score of const uchar* in qtruby4.rb/checkarg().
However, Ruby then segfaults during initializer.call(*args).

The execution internally reaches
initialize_qt(int argc, VALUE * argv, VALUE self)
in ruby/qtruby/src/qtruby.cpp and breaks somewhere in there.

Is there a general problem with converting from Ruby String to uchar*
(and so none of the uchar* methods would work), or is the problem
somewhere else?

Thanks,
-doc



More information about the Kde-bindings mailing list