qprintsupport: add example

This commit is contained in:
mappu 2024-10-19 09:45:54 +13:00
parent c6827726f7
commit 360696cff8
2 changed files with 30 additions and 0 deletions

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ examples/windowsmanifest/windowsmanifest
examples/windowsmanifest/windowsmanifest.exe examples/windowsmanifest/windowsmanifest.exe
examples/uidesigner/uidesigner examples/uidesigner/uidesigner
examples/uidesigner/uidesigner.exe examples/uidesigner/uidesigner.exe
examples/libraries/qt-qprintsupport/qt-qprintsupport
# android temporary build files # android temporary build files
android-build android-build

View File

@ -0,0 +1,29 @@
package main
import (
"os"
"github.com/mappu/miqt/qt"
"github.com/mappu/miqt/qt/qprintsupport"
)
func main() {
qt.NewQApplication(os.Args)
btn := qt.NewQPushButton2("QPrintSupport sample")
btn.SetFixedWidth(320)
btn.OnPressed(func() {
dlg := qprintsupport.NewQPrintDialog2()
dlg.OnFinished(func(int) {
dlg.DeleteLater()
})
dlg.Show()
})
btn.Show()
qt.QApplication_Exec()
}