qt: rebuild (call runtime.LockOSThread in QApplication ctors)

This commit is contained in:
mappu 2024-11-18 19:34:48 +13:00
parent fe6e9ce30b
commit 5955fdb6ef
6 changed files with 36 additions and 0 deletions

View File

@ -61,6 +61,9 @@ func NewQApplication(args []string) *QApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QApplication_new(argc, &argv[0])
return newQApplication(ret)
}
@ -74,6 +77,9 @@ func NewQApplication2(args []string, param3 int) *QApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QApplication_new2(argc, &argv[0], (C.int)(param3))
return newQApplication(ret)
}

View File

@ -59,6 +59,9 @@ func NewQCoreApplication(args []string) *QCoreApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QCoreApplication_new(argc, &argv[0])
return newQCoreApplication(ret)
}
@ -72,6 +75,9 @@ func NewQCoreApplication2(args []string, param3 int) *QCoreApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QCoreApplication_new2(argc, &argv[0], (C.int)(param3))
return newQCoreApplication(ret)
}

View File

@ -53,6 +53,9 @@ func NewQGuiApplication(args []string) *QGuiApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QGuiApplication_new(argc, &argv[0])
return newQGuiApplication(ret)
}
@ -66,6 +69,9 @@ func NewQGuiApplication2(args []string, param3 int) *QGuiApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QGuiApplication_new2(argc, &argv[0], (C.int)(param3))
return newQGuiApplication(ret)
}

View File

@ -53,6 +53,9 @@ func NewQApplication(args []string) *QApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QApplication_new(argc, &argv[0])
return newQApplication(ret)
}
@ -66,6 +69,9 @@ func NewQApplication2(args []string, param3 int) *QApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QApplication_new2(argc, &argv[0], (C.int)(param3))
return newQApplication(ret)
}

View File

@ -59,6 +59,9 @@ func NewQCoreApplication(args []string) *QCoreApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QCoreApplication_new(argc, &argv[0])
return newQCoreApplication(ret)
}
@ -72,6 +75,9 @@ func NewQCoreApplication2(args []string, param3 int) *QCoreApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QCoreApplication_new2(argc, &argv[0], (C.int)(param3))
return newQCoreApplication(ret)
}

View File

@ -53,6 +53,9 @@ func NewQGuiApplication(args []string) *QGuiApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QGuiApplication_new(argc, &argv[0])
return newQGuiApplication(ret)
}
@ -66,6 +69,9 @@ func NewQGuiApplication2(args []string, param3 int) *QGuiApplication {
for i := range args {
argv[i] = C.CString(args[i])
}
runtime.LockOSThread() // Prevent Go from migrating the main Qt thread
ret := C.QGuiApplication_new2(argc, &argv[0], (C.int)(param3))
return newQGuiApplication(ret)
}