Open averrin opened 9 years ago
My next idea:
model := new(qml.List)
model.Convert(&options.Profiles)
context.SetVar("ProfilesModel", model)
But, it have no effect:
ComboBox.qml:503: file:///usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Controls/ComboBox.qml:503:23: Unable to assign List to QString
I've been hitting the same issue tonight, so I'm very interested in this. Have you found a workaround?
Yeah, but with big hack. I think, go-qml still not usefull. Workaround: https://github.com/averrin/openmw_launcher/blob/4fbd384879d3067c06c7f6f747d8c6f57079fa6c/src/main.qml https://github.com/averrin/openmw_launcher/blob/4fbd384879d3067c06c7f6f747d8c6f57079fa6c/src/launcher.go But this solution have a strange random bugs.
I've quickly looked over it, and it seems a great idea. I will try it a bit later and see how it works for me, thank you for sharing it!
It worked! You saved me!
I created a more general bug report regarding []string crashes here: https://github.com/go-qml/qml/issues/132 It also contains a reference to the delegate example, which is (in my opinion) a better workaround for this model issue.
In QML:
ComboBox { model: profiles }
where
profiles := []string{"one", "two"}
and in console output:
panic: handling of []string (&[]string{"one", "two"}) is incomplete; please report to the developers
Is there workaround, or ComboBox is broken?