File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ package app
2
+
3
+ import (
4
+ "log"
5
+ "os"
6
+ "runtime"
7
+ )
8
+
9
+ func checkOStype () {
10
+ if runtime .GOOS == "linux" {
11
+ os .Setenv ("QT_QPA_PLATFORM" , "xcb" ) // Sets x11 for linux
12
+ log .Println ("Running on Linux" )
13
+ } else if runtime .GOOS == "windows" {
14
+ log .Println ("Running on Windows" )
15
+ } else if runtime .GOOS == "darwin" {
16
+ log .Println ("Running on MacOS" )
17
+ } else {
18
+ log .Println ("System type cannot be detected" )
19
+ }
20
+ }
Original file line number Diff line number Diff line change @@ -490,6 +490,8 @@ func (w *MainWindow) exit(_ bool) {
490
490
491
491
func Main () {
492
492
493
+ checkOStype ()
494
+
493
495
app := widgets .NewQApplication (len ([]string {}), []string {})
494
496
495
497
if core .QCoreApplication_Instance () == nil {
You can’t perform that action at this time.
0 commit comments