PDA

View Full Version : QtScript Q_ENUM problem



oc2k1
14th May 2007, 16:07
Hi,

I've start to develop my application with QT-4.2 and QSA-1.2.2. QSA was always problematic to install. So I start a second port to use QtScript as interpreter. The most of porting wasn't a problem, but my OpenGL wrapper requires many constants. On QSA it was enough to collect them as Q_ENUM, but on QtScript that work only for prototype objects. Unfortunately wrapped.

I have to possibilities to wrap a object to QtScript:

That creates a prototype object with working enums but nonworking functions:

Q_SCRIPT_DECLARE_QMETAOBJECT(glwrapper, QObject*);
somefunction(){
ip->globalObject().setProperty("glproto" ,ip->scriptValueFromQMetaObject<glwrapper>());
}

or an wrapped object without working enums:

ip->globalObject().setProperty("gl" , ip->newQObject(ogl));

The support says it feature. I say that is a bug... (or design error?)

My project homepage:
http://lumina.sourceforge.net/