> Hmm - I'm absolutely sure its defined nowhere else in my (rather huge)
> application.
Maybe it has to do something with the file that are included?
> But my usecase is a little different:
>
> qs:
> var child = Form.findChild ("child1");
> var children = child.findObjects ("MyClass");
I know no findObjects function in Qt. maybe you meant findChildren?
Still the attached code does work work for me, both with 4.5 and 4.6.
Some compilable code sample would be really usefull.
#include <QtGui>
#include <QtScript>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QScriptEngine e;
QObject *o = new QObject;
QObject *c = new QObject(o);
c->setObjectName("child1");
e.globalObject().setProperty("Form", e.newQObject(o));
qDebug() << e.evaluate(
"var child = Form.findChild(\"child1\");\n"
"var children = Form.findChildren (\"child1\");\n"
"children\n").toString();
}
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback