--- a/ui/qt/button.cpp Wed Mar 26 21:47:04 2025 +0100 +++ b/ui/qt/button.cpp Wed Mar 26 21:54:42 2025 +0100 @@ -30,3 +30,20 @@ #include "container.h" #include "toolkit.h" +UIWIDGET ui_button_create(UiObject* obj, UiButtonArgs args) { + UiContainerPrivate *ctn = ui_obj_container(obj); + UI_APPLY_LAYOUT(ctn->layout, args); + + QString str = QString::fromUtf8(args.label); + QPushButton *button = new QPushButton(str); + + if(args.onclick) { + UiEventWrapper *event = new UiEventWrapper(obj, args.onclick, args.onclickdata); + button->connect(button, SIGNAL(clicked()), event, SLOT(slot())); + } + + ctn->add(button, false); + + return button; +} +