-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*widgets.QPushButton not working for ConnectClicked(func(_ bool) { } #854
Comments
Hey It should work with these changes: var loader = uitools.NewQUiLoader(nil)
var file = core.NewQFile2("mainwindow.ui")
+ var widget = widgets.NewQWidget(nil, 0)
file.Open(core.QIODevice__ReadOnly)
- w.widget = widgets.NewQWidgetFromPointer(loader.Load(file, nil).Pointer())
+ w.widget = widgets.NewQWidgetFromPointer(loader.Load(file, widget).Pointer())
file.Close()
- w.PicBox = widgets.NewQLabelFromPointer(w.FindChild("PicBox", core.Qt__FindChildrenRecursively).Pointer())
- w.btn1 = widgets.NewQPushButtonFromPointer(w.FindChild("startBtn", core.Qt__FindChildrenRecursively).Pointer())
- w.btn2 = widgets.NewQPushButtonFromPointer(w.FindChild("stopBtn", core.Qt__FindChildrenRecursively).Pointer())
- w.btn3 = widgets.NewQPushButtonFromPointer(w.FindChild("takePicture", core.Qt__FindChildrenRecursively).Pointer())
+ w.PicBox = widgets.NewQLabelFromPointer(widget.FindChild("PicBox", core.Qt__FindChildrenRecursively).Pointer())
+ w.btn1 = widgets.NewQPushButtonFromPointer(widget.FindChild("startBtn", core.Qt__FindChildrenRecursively).Pointer())
+ w.btn2 = widgets.NewQPushButtonFromPointer(widget.FindChild("stopBtn", core.Qt__FindChildrenRecursively).Pointer())
+ w.btn3 = widgets.NewQPushButtonFromPointer(widget.FindChild("takePicture", core.Qt__FindChildrenRecursively).Pointer())
// open WebCam
w.btn1.ConnectClicked(func(_ bool) { It seems like you need to provide a parent when calling |
@therecipe thanks, code is working now . |
@sndnvaps I recently added support for the uic with 01e05b1 Maybe checkout the difference between these examples https://github.com/therecipe/qt/tree/master/internal/examples/uitools/calculator for this to work you will only need to update the binding and then ut your |
dev platform:
my code is as below
mainform.ui is in videoCapture.zip
videoCapture.zip
The text was updated successfully, but these errors were encountered: