mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
uic: emit warnings for unhandled item properties
This commit is contained in:
parent
4c6062de1f
commit
8d07be763a
@ -330,8 +330,13 @@ func generateWidget(w UiWidget, parentName string, parentClass string) (string,
|
||||
// Check for a "text" property and update the item's text
|
||||
// Do this as a 2nd step so that the SetItemText can be trapped for retranslateUi()
|
||||
// TODO Abstract for all SetItem{Foo} properties
|
||||
if prop, ok := propertyByName(itm.Properties, "text"); ok {
|
||||
ret.WriteString("ui." + w.Name + `.SetItemText(` + fmt.Sprintf("%d", itemNo) + `, ` + generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||
for _, prop := range itm.Properties {
|
||||
if prop.Name == "text" {
|
||||
ret.WriteString("ui." + w.Name + `.SetItemText(` + fmt.Sprintf("%d", itemNo) + `, ` + generateString(prop.StringVal, w.Class) + `)` + "\n")
|
||||
} else {
|
||||
ret.WriteString("/* miqt-uic: no handler for item property '" + prop.Name + "' */\n")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user