Declare object variable
-
I'm using stackview I have declared component
Component { id: dog Dog { } }I push new object to stack view like so
stackView.push(dog)From documentation push method returns object - Item. in my case object is Dog and Dog has method test(txt). I want to call that method this works:
var asd = stackView.push(dog) asd.test("ta")But is there a way to do something like this?
Dog asd = stackView.push(dog) asd.test("ta") -
I'm using stackview I have declared component
Component { id: dog Dog { } }I push new object to stack view like so
stackView.push(dog)From documentation push method returns object - Item. in my case object is Dog and Dog has method test(txt). I want to call that method this works:
var asd = stackView.push(dog) asd.test("ta")But is there a way to do something like this?
Dog asd = stackView.push(dog) asd.test("ta")@Eligijus said in Declare object variable:
But is there a way to do something like this?
no, since that's the nature of JavaScript. It's not type-safe, so no need to declare an item-type of a variable.
-
@Eligijus said in Declare object variable:
But is there a way to do something like this?
no, since that's the nature of JavaScript. It's not type-safe, so no need to declare an item-type of a variable.
@raven-worx In this case by using
varautocomplete stops working is there a fix?