mirror of
https://github.com/mappu/miqt.git
synced 2025-05-30 23:00:26 +00:00
miqt-uic: support Tr() for top-level SetWindowText
This commit is contained in:
parent
7d9cb9ccd2
commit
86d963abba
@ -72,10 +72,13 @@ func (gs *generateState) collectClassNames_Widget(u *UiWidget) []string {
|
||||
}
|
||||
|
||||
func (gs *generateState) generateString(s *UiString, parentClass string) string {
|
||||
if s.Notr || parentClass == "" {
|
||||
if s.Notr {
|
||||
return strconv.Quote(s.Value)
|
||||
} else if parentClass == "" {
|
||||
return `qt.QCoreApplication_Tr(` + strconv.Quote(s.Value) + `)`
|
||||
} else {
|
||||
return `qt.` + parentClass + `_Tr(` + strconv.Quote(s.Value) + `)`
|
||||
}
|
||||
return `qt.` + parentClass + `_Tr(` + strconv.Quote(s.Value) + `)`
|
||||
}
|
||||
|
||||
// qwidgetName creates the T.QWidget name that MIQT needs to access the base class.
|
||||
|
Loading…
x
Reference in New Issue
Block a user