Skip to content

Commit

Permalink
go-uic : qt 5.12
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrongzhan committed Dec 24, 2018
1 parent e91de41 commit 6572980
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/go-uic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func onSetupUi(line string) {
} else {
reg1 := regexp.MustCompile(`(.*) = new (Q.+)\(([0-9A-Za-z_]*)?\);`)
reg2 := regexp.MustCompile(`(.*)->setObjectName\(QStringLiteral\((.+)\)\);`)
reg2_1 := regexp.MustCompile(`(.*)->setObjectName\(QString::fromUtf8\((.+)\)\)`)
reg3 := regexp.MustCompile(`(.*)->(set.+Size)\(QSize\((.+)\)\);`)
reg4 := regexp.MustCompile(`([^->]+)[->.]+set([^(]+)\((.+)\);`)
reg5 := regexp.MustCompile(`([^->]+)[->.]+(add[^(]+)\((.+)\);`)
Expand Down Expand Up @@ -237,6 +238,13 @@ func onSetupUi(line string) {
log.Println(mats)
cp.APf("setupUi", "this.%s.SetObjectName(%s) // 112",
strings.Title(mats[0][1]), strings.Title(mats[0][2]))
} else if reg2_1.MatchString(line) {
log.Println("reg2_1")
mats := reg2_1.FindAllStringSubmatch(line, -1)
log.Println(mats)
log.Println(strings.Title(mats[0][2]))
cp.APf("setupUi", "this.%s.SetObjectName(%s) // 112",
strings.Title(mats[0][1]), strings.Title(mats[0][2]))
} else if reg3.MatchString(line) {
mats := reg3.FindAllStringSubmatch(line, -1)
log.Println(mats)
Expand Down

0 comments on commit 6572980

Please sign in to comment.