QSA-interest Archive, October 2006
Class definition weirdness
Message 1 in thread
I am having some odd behavior surrounding when QSA thinks that my class
is defined. Here is some sample code:
Var foo = new Foo();
Connect(box, "clicked()", foo.test);
Class Foo
{
function Foo(){}
function test()
{
var bar = new Bar();
}
}
Class Bar
{
function Bar(){}
}
If I click on the box, I get an error message saying "Error. Use of
undefined variable Bar". If I replace the top two lines with:
Var foo = new Foo();
foo.test();
Then it works just fine. I'm thinking must have something to do with
the differing scope when "test" is called through a signal rather than
directly, but it seems that it should understand that Bar is a class in
either situation. Anyone have a fix for this, or know a way around it?
Thanks!
Cheryl Simon
Cheryl.Simon@xxxxxxx