Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Go + QtでiOS アプリ開発

matuyuji
December 26, 2016

Go + QtでiOS アプリ開発

GoとQtを使うとコマンドラインからiOSアプリが作れます

matuyuji

December 26, 2016
Tweet

More Decks by matuyuji

Other Decks in Programming

Transcript

  1. Qt binding for Go which supports Windows / macOS /

    Linux / Android / iOS / Sailfish OS / Raspberry Pi
  2. brew install go export GOROOT=/usr/local/opt/go/libexec export GOPATH=$HOME/.go open qt-opensource-mac-x64-android-ios-5.7.0.dmg export

    QT_DIR=$HOME/Qt5.7.0 go get -d github.com/therecipe/qt cd $GOPATH/src/github.com/therecipe/qt ./setup.sh ./setup.sh ios ./setup.sh iossiumlator
  3. NBJOHP package main import ( "os" "github.com/therecipe/qt/core" "github.com/therecipe/qt/widgets" ) func

    main() { widgets.NewQApplication(len(os.Args), os.Args) //create a button and connect the clicked signal var button = widgets.NewQPushButton2("Click me!", nil) button.ConnectClicked(func(flag bool) { widgets.QMessageBox_Information(nil, "OK", "You clicked me!”, widgets.QMessageBox__Ok, widgets.QMessageBox__Ok) }) //create a layout and add the button var layout = widgets.NewQVBoxLayout() layout.AddWidget(button, 0, core.Qt__AlignCenter) //create a window, add the layout and show the window var window = widgets.NewQMainWindow(nil, 0) window.SetWindowTitle("Hello World Example") window.SetMinimumSize2(200, 200) window.Layout().DestroyQObject() window.SetLayout(layout) window.Show() widgets.QApplication_Exec() }
  4. RUEFQMPZSVOJPTTJNVMBUPS $ qtdeploy —-help usage: qtdeploy [ build | run

    | test ] [ desktop | android | ios | ios-simulator | sailfish | sailfish-emulator | rpi1 | rpi2 | rpi3 | windows ] [ path/to/project ] [ docker ]