diff --git a/src/plugins/lua/bindings/gui.cpp b/src/plugins/lua/bindings/gui.cpp index 02581a10edc..83db3410841 100644 --- a/src/plugins/lua/bindings/gui.cpp +++ b/src/plugins/lua/bindings/gui.cpp @@ -94,6 +94,8 @@ void constructWidget(std::unique_ptr &widget, const sol::table &children) HAS_MEM_FUNC(onTextChanged, hasOnTextChanged); HAS_MEM_FUNC(onClicked, hasOnClicked); HAS_MEM_FUNC(setText, hasSetText); +HAS_MEM_FUNC(setMarkdown, hasSetMarkdown); +HAS_MEM_FUNC(setReadOnly, hasSetReadOnly); HAS_MEM_FUNC(setTitle, hasSetTitle); HAS_MEM_FUNC(setValue, hasSetValue); HAS_MEM_FUNC(setSize, hasSetSize); @@ -176,7 +178,14 @@ void setProperties(std::unique_ptr &item, const sol::table &children, QObject } } if constexpr (hasSetText::value) { - item->setText(children.get_or("text", "")); + auto text = children.get>("text"); + if (text) + item->setText(*text); + } + if constexpr (hasSetMarkdown::value) { + auto markdown = children.get>("markdown"); + if (markdown) + item->setMarkdown(*markdown); } if constexpr (hasSetTitle::value) { item->setTitle(children.get_or("title", "")); @@ -186,6 +195,11 @@ void setProperties(std::unique_ptr &item, const sol::table &children, QObject if (value) item->setValue(*value); } + if constexpr (hasSetReadOnly::value) { + sol::optional readOnly = children.get>("readOnly"); + if (readOnly) + item->setReadOnly(*readOnly); + } } template