miqt/examples/libraries/qt-script/main.go
2024-11-26 19:55:26 +13:00

24 lines
337 B
Go

package main
import (
"fmt"
"os"
"github.com/mappu/miqt/qt"
"github.com/mappu/miqt/qt/script"
)
func main() {
qt.NewQApplication(os.Args)
inputProgram := "1 + 2"
eng := script.NewQScriptEngine()
result := eng.Evaluate(inputProgram)
fmt.Printf("%s = %1.f\n", inputProgram, result.ToNumber())
// qt.QApplication_Exec()
}