go-qml / qml

QML support for the Go language
Other
1.96k stars 187 forks source link

Better support for embedded types. #65

Open michael-k opened 10 years ago

michael-k commented 10 years ago

I have a struct with an embedded type. In QML, the access to the fields of the embedded type are only possible if given the full qualifier.

So my question is, whether it would be possible to support embedded types in a way that makes the example work.

Here is some example code:

go code:

type Person struct {
    LastName  string
    FirstName string
}

type SpecialPerson struct {
    Number string
    Person
}

qml code (with the commented out line instead, it works):

TextField {
    text: specialPerson.firstName
    //text: specialPerson.person.firstName
}

error message:

Unable to assign [undefined] to QString