mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 00:48:38 +00:00
qt6: add example
This commit is contained in:
parent
97c05b7fc7
commit
1e51c9f314
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,6 +27,7 @@ examples/uidesigner/uidesigner
|
||||
examples/uidesigner/uidesigner.exe
|
||||
examples/libraries/extras-scintillaedit/extras-scintillaedit
|
||||
examples/libraries/qt-qprintsupport/qt-qprintsupport
|
||||
examples/libraries/qt6/qt6
|
||||
examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla
|
||||
|
||||
# android temporary build files
|
||||
|
29
examples/libraries/qt6/main.go
Normal file
29
examples/libraries/qt6/main.go
Normal file
@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
btn := qt.NewQPushButton2("Hello world!")
|
||||
btn.SetFixedWidth(320)
|
||||
|
||||
var counter int = 0
|
||||
|
||||
btn.OnPressed(func() {
|
||||
counter++
|
||||
btn.SetText(fmt.Sprintf("You have clicked the button %d time(s)", counter))
|
||||
})
|
||||
|
||||
btn.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
|
||||
fmt.Println("OK!")
|
||||
}
|
Loading…
Reference in New Issue
Block a user