diff --git a/.gitignore b/.gitignore index ddd720ec..d9aa693f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/examples/libraries/qt6/main.go b/examples/libraries/qt6/main.go new file mode 100644 index 00000000..f1d0861e --- /dev/null +++ b/examples/libraries/qt6/main.go @@ -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!") +}