[Kde-bindings] QScriptValue method_missing
David Palacio
dpalacio at uninorte.edu.co
Sun Jul 19 15:29:26 UTC 2009
I can not get data from QScriptValues as I get this backtrace when calling a
method.
NoMethodError: undefined method `name' for nil:NilClass
from /home/kde/ruby/lib/Qt/qtruby4.rb:2603:in `do_method_missing'
from /home/kde/ruby/lib/Qt/qtruby4.rb:2606:in `do_method_missing'
from (irb):6:in `method_missing'
from (irb):6
I also note that the ruby module the QScriptEngine class resides in (Qt) is
different to the QScriptValue one (QtScript). Is this intentional?
##test.rb
require 'Qt4'
require 'qtscript'
eng = Qt::ScriptEngine.new
v = eng.evaluate '42'
puts v.toString
//test.cpp works
#include <QtCore/QDebug>
#include <QtScript/QScriptEngine>
#include <QtScript/QScriptValue>
int main(int argc, char *argv[])
{
QScriptEngine eng;
QScriptValue v = eng.evaluate("42");
qDebug() << v.toString();
return 0;
}
More information about the Kde-bindings
mailing list