mirror of
https://github.com/mappu/miqt.git
synced 2025-04-27 07:30:22 +00:00
pdf: Add Qt PDF examples
This commit is contained in:
parent
c43c65ee2a
commit
fdb15300e8
BIN
examples/libraries/qt-pdf/example.pdf
Normal file
BIN
examples/libraries/qt-pdf/example.pdf
Normal file
Binary file not shown.
27
examples/libraries/qt-pdf/main.go
Normal file
27
examples/libraries/qt-pdf/main.go
Normal file
@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/mappu/miqt/qt"
|
||||
"github.com/mappu/miqt/qt/pdf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
d := pdf.NewQPdfDocument()
|
||||
d.Load("example.pdf")
|
||||
|
||||
p := pdf.NewQPdfView2()
|
||||
p.SetWindowTitle("Qt 5 PDF Example")
|
||||
p.SetMinimumSize2(650, 600)
|
||||
p.SetPageMode(pdf.QPdfView__MultiPage)
|
||||
p.SetZoomMode(pdf.QPdfView__FitInView)
|
||||
p.SetDocument(d)
|
||||
|
||||
p.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
}
|
BIN
examples/libraries/qt-pdf/screenshot.png
Normal file
BIN
examples/libraries/qt-pdf/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
examples/libraries/qt6-pdf/example.pdf
Normal file
BIN
examples/libraries/qt6-pdf/example.pdf
Normal file
Binary file not shown.
27
examples/libraries/qt6-pdf/main.go
Normal file
27
examples/libraries/qt6-pdf/main.go
Normal file
@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
qt "github.com/mappu/miqt/qt6"
|
||||
"github.com/mappu/miqt/qt6/pdf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
qt.NewQApplication(os.Args)
|
||||
|
||||
d := pdf.NewQPdfDocument()
|
||||
d.Load("example.pdf")
|
||||
|
||||
p := pdf.NewQPdfView2()
|
||||
p.SetWindowTitle("Qt 6 PDF Example")
|
||||
p.SetMinimumSize2(650, 600)
|
||||
p.SetPageMode(pdf.QPdfView__MultiPage)
|
||||
p.SetZoomMode(pdf.QPdfView__FitInView)
|
||||
p.SetDocument(d)
|
||||
|
||||
p.Show()
|
||||
|
||||
qt.QApplication_Exec()
|
||||
}
|
BIN
examples/libraries/qt6-pdf/screenshot.png
Normal file
BIN
examples/libraries/qt6-pdf/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
Loading…
x
Reference in New Issue
Block a user