Einführung in die Sprache Go anhand von Beispielen
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.4 KiB

package myGui
import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/uitools"
"github.com/therecipe/qt/widgets"
)
func ErzeugeLayout(widget *widgets.QWidget, formWidget *widgets.QWidget, t *[]int, ch chan bool) (*widgets.QTextBrowser, *widgets.QLCDNumber, *widgets.QProgressBar, *widgets.QHBoxLayout) { //Beispiel für Rückgabeparameter als Tupel
var (
ui_textBrowser = widgets.NewQTextBrowserFromPointer(widget.FindChild("textAusgabefeld", core.Qt__FindChildrenRecursively).Pointer())
ui_lcdNummer = widgets.NewQLCDNumberFromPointer(widget.FindChild("lcdNumber", core.Qt__FindChildrenRecursively).Pointer())
ui_progressBar = widgets.NewQProgressBarFromPointer(widget.FindChild("progressBar", core.Qt__FindChildrenRecursively).Pointer())
ui_sliderArea = widgets.NewQHBoxLayoutFromPointer(widget.FindChild("sliderArea", core.Qt__FindChildrenRecursively).Pointer())
)
var layout = widgets.NewQVBoxLayout()
widget.SetLayout(layout)
layout.AddWidget(formWidget, 0, 0)
widget.SetWindowTitle("LGL, go4go!")
widget.ShowMaximized()
return ui_textBrowser, ui_lcdNummer, ui_progressBar, ui_sliderArea
}
func LeseUIFile(widget *widgets.QWidget) *widgets.QWidget {
var loader = uitools.NewQUiLoader(nil)
var file = core.NewQFile2("./myGui/qml/formular.ui")
file.Open(core.QIODevice__ReadOnly)
var formWidget *widgets.QWidget = loader.Load(file, widget)
file.Close()
return formWidget
}