go-qml/qml — pull request #60 by xlab (2014-04-14 19:12:54+00:00)
Title: Type-independent analogue for qml.ObjectByName

Hi! There is a little issue with the `qml.ObjectByName` method. Actually it works only with standard QML-objects and fails for exported Go types.

#### <example story>
```
import MyTypes 1.0
Item {
id: root
MyType {
objectName: "control"
}
}
```
I cannot just write `win.Root().ChildByName("control").(*Ctrl)`, which is idiomatic in Qt, but need to write an additional property alias:
```
import MyTypes 1.0
Item {
id: root
property alias control: control
MyType {
id: control
objectName: "control"
}
}
```
and then retrieve my go-object with `win.Root().Property("control").Interface().(*Ctrl)`, that's a bit clumsy (imho).
#### </example story>

The problem arises from the `qml.ObjectByName` implementation:
```
object, ok := unpackDataValue(&dvalue, obj.engine).(Object)
if !ok {
panic(fmt.Sprintf("cannot find descendant with objectName == %q", objectName))
}
```
and of course my custom type is not `qml.Object` (even with embedding of `*qml.Common` on the Go-side).

So I've made a general method that finds objects and treats them as `interface{}`. Please consider the pull request as a reference. The question is — which is the more idiomatic way to retrieve created go-objects from the qml-context, and do we need that kind of method (which treats found objects as `interface{}`s) in the future and what is your personal opinion for that? Thanks!