You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying my hand at creating a dynamically-populated table from data in go, when I got a please report to the developers error:
panic: handling of []main.ColumnHeader (&[]main.ColumnHeader{main.ColumnHeader{Text:"Test text header", Role:"sign", Kind:3}, main.ColumnHeader{Text:"Bool Header", Role:"isok", Kind:0}, main.ColumnHeader{Text:"Integer", Role:"num", Kind:1}}) is incomplete; please report to the developers
I am basically trying to access the following struct definitions with test data:
The registration on the go side to make it accessible:
funcmain() {
// ...engine:=qml.NewEngine()
context:=engine.Context()
// Define the value to share to QMLtableModel:=TableData {
// Lots of handrolled test data
}
context.SetVar("tableData", &tableModel)
// ...
}
I looked into other API calls to see if I was doing something incorrect. Nothing seemed obvious to me. The only thing slightly relevant could be registering the ColumnHeader go type, but I am not instantiating new copies of that struct on the qml side. I have another data type (lets call it AppSettings) that is SetVard similarly but does not have any interactions with TableViews. AppSettings also contains a slice of structs from a different package that is nothing but a struct of primitives, and it seems to do fine, so I am slightly baffled.
The text was updated successfully, but these errors were encountered:
+1. I've been unable to hand over anything but basic structs containing strings, ints/floats, and bools and no nesting, slices, maps, or arrays. Everything else I've tried in go-qml has worked great though, I feel this would add a lot of functionality. It might currently be possible to publish some json string to QML and unmarshal them there but that seems silly.
The current workaround is to add go functions that do array accessing or manipulation or storing. These functions can be called from qml and enable slice manipulation via these function calls. It is more verbose than native support, but it works.
+1. I've been unable to hand over anything but basic structs containing strings, ints/floats, and bools and no nesting, slices, maps, or arrays. Everything else I've tried in go-qml has worked great though, I feel this would add a lot of functionality. It might currently be possible to publish some json string to QML and unmarshal them there but that seems silly.
—
Reply to this email directly or view it on GitHub.
I was trying my hand at creating a dynamically-populated table from data in go, when I got a
please report to the developers
error:I am basically trying to access the following struct definitions with test data:
The registration on the go side to make it accessible:
The basic QML:
I looked into other API calls to see if I was doing something incorrect. Nothing seemed obvious to me. The only thing slightly relevant could be registering the
ColumnHeader
go type, but I am not instantiating new copies of that struct on the qml side. I have another data type (lets call itAppSettings
) that isSetVar
d similarly but does not have any interactions with TableViews.AppSettings
also contains a slice of structs from a different package that is nothing but a struct of primitives, and it seems to do fine, so I am slightly baffled.The text was updated successfully, but these errors were encountered: