mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 00:48:38 +00:00
genbindings/qapplication: use LockOSThread() to bind Qt main thread
This commit is contained in:
parent
4f57b3bd5e
commit
fe6e9ce30b
@ -272,6 +272,12 @@ func (gfs *goFileState) emitParametersGo2CABIForwarding(m CppMethod) (preamble s
|
||||
|
||||
tmp = append(tmp, "argc, &argv[0]")
|
||||
|
||||
// Additional quirk for QApplication constructor: bind to OS thread
|
||||
gfs.imports["runtime"] = struct{}{}
|
||||
preamble += "\n"
|
||||
preamble += "runtime.LockOSThread() // Prevent Go from migrating the main Qt thread\n"
|
||||
preamble += "\n"
|
||||
|
||||
} else if skipNext {
|
||||
// Skip this parameter, already handled
|
||||
skipNext = false
|
||||
|
Loading…
Reference in New Issue
Block a user