forked from qt-creator/qt-creator
Lua: Bind openExternalLinks
Change-Id: I8b8f1083feec63bd36689f36db38a7a895ebf9dd Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -105,6 +105,7 @@ HAS_MEM_FUNC(setWidgetAttribute, hasSetWidgetAttribute);
|
|||||||
HAS_MEM_FUNC(setAutoFillBackground, hasSetAutoFillBackground);
|
HAS_MEM_FUNC(setAutoFillBackground, hasSetAutoFillBackground);
|
||||||
HAS_MEM_FUNC(setIconPath, hasSetIconPath);
|
HAS_MEM_FUNC(setIconPath, hasSetIconPath);
|
||||||
HAS_MEM_FUNC(setFlat, hasSetFlat);
|
HAS_MEM_FUNC(setFlat, hasSetFlat);
|
||||||
|
HAS_MEM_FUNC(setOpenExternalLinks, hasSetOpenExternalLinks);
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void setProperties(std::unique_ptr<T> &item, const sol::table &children, QObject *guard) {
|
void setProperties(std::unique_ptr<T> &item, const sol::table &children, QObject *guard) {
|
||||||
@@ -201,6 +202,12 @@ void setProperties(std::unique_ptr<T> &item, const sol::table &children, QObject
|
|||||||
if (readOnly)
|
if (readOnly)
|
||||||
item->setReadOnly(*readOnly);
|
item->setReadOnly(*readOnly);
|
||||||
}
|
}
|
||||||
|
if constexpr (hasSetOpenExternalLinks<T, void (T::*)(bool)>::value) {
|
||||||
|
sol::optional<bool> openExternalLinks = children.get<sol::optional<bool>>(
|
||||||
|
"openExternalLinks");
|
||||||
|
if (openExternalLinks)
|
||||||
|
item->setOpenExternalLinks(*openExternalLinks);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
Reference in New Issue
Block a user