examples: add windows manifest example

This commit is contained in:
mappu 2024-09-03 20:30:03 +12:00
parent 9448418a8d
commit 99b4b9c6cb
6 changed files with 87 additions and 0 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View 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!")
}

Binary file not shown.

View 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
}
}
}
}