mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 00:48:38 +00:00
examples: add windows manifest example
This commit is contained in:
parent
9448418a8d
commit
99b4b9c6cb
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,3 +14,5 @@ examples/helloworld/helloworld
|
||||
examples/helloworld/helloworld.exe
|
||||
examples/mdoutliner/mdoutliner
|
||||
examples/mdoutliner/mdoutliner.exe
|
||||
examples/windowsmanifest/windowsmanifest
|
||||
examples/windowsmanifest/windowsmanifest.exe
|
@ -89,3 +89,5 @@ For dynamically-linked builds (closed-source or open source application):
|
||||
3. Copy necessary Qt LGPL libraries.
|
||||
|
||||
For repeated builds, the compile speed can be improved if you also bind-mount the Docker container's `GOCACHE` directory: `-v $(pwd)/container-build-cache:/root/.cache/go-build`
|
||||
|
||||
To add an icon and other properties to the .exe, you can use [the go-winres tool](https://github.com/tc-hib/go-winres). See the `examples/windowsmanifest` for details.
|
||||
|
BIN
examples/windowsmanifest/app_icon.png
Normal file
BIN
examples/windowsmanifest/app_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
29
examples/windowsmanifest/main.go
Normal file
29
examples/windowsmanifest/main.go
Normal file
@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/mappu/miqt/qt"
|
||||
)
|
||||
|
||||
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!")
|
||||
}
|
BIN
examples/windowsmanifest/rsrc_windows_amd64.syso
Normal file
BIN
examples/windowsmanifest/rsrc_windows_amd64.syso
Normal file
Binary file not shown.
54
examples/windowsmanifest/winres.json
Normal file
54
examples/windowsmanifest/winres.json
Normal file
@ -0,0 +1,54 @@
|
||||
{
|
||||
"RT_GROUP_ICON": {
|
||||
"APP": {
|
||||
"0000": "app_icon.png"
|
||||
}
|
||||
},
|
||||
"RT_VERSION": {
|
||||
"#1": {
|
||||
"0000": {
|
||||
"fixed": {
|
||||
"file_version": "1.2.3.4",
|
||||
"product_version": "1.2.3.42"
|
||||
},
|
||||
"info": {
|
||||
"0409": {
|
||||
"Comments": "MIQT Sample comment",
|
||||
"CompanyName": "MIQT Sample company",
|
||||
"FileDescription": "MIQT Sample description",
|
||||
"FileVersion": "1.2.3.4",
|
||||
"LegalCopyright": "MIQT Sample copyright",
|
||||
"LegalTrademarks": "MIQT Sample trademarks",
|
||||
"ProductName": "MIQT Sample product",
|
||||
"ProductVersion": "MIQT Sample product version"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"RT_MANIFEST": {
|
||||
"#1": {
|
||||
"0409": {
|
||||
"identity": {
|
||||
"name": "",
|
||||
"version": ""
|
||||
},
|
||||
"description": "",
|
||||
"minimum-os": "win7",
|
||||
"execution-level": "as invoker",
|
||||
"ui-access": false,
|
||||
"auto-elevate": false,
|
||||
"dpi-awareness": "per monitor v2",
|
||||
"disable-theming": false,
|
||||
"disable-window-filtering": false,
|
||||
"high-resolution-scrolling-aware": false,
|
||||
"ultra-high-resolution-scrolling-aware": false,
|
||||
"long-path-aware": false,
|
||||
"printer-driver-isolation": false,
|
||||
"gdi-scaling": false,
|
||||
"segment-heap": false,
|
||||
"use-common-controls-v6": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user