mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2026-04-01 20:50:41 +02:00
add more widget enabled and visible options
This commit is contained in:
parent
1823511204
commit
9e2b5acca5
2 changed files with 47 additions and 0 deletions
|
|
@ -83,6 +83,8 @@ void LuaEngineGui::pushClass(lua_State *L_p)
|
|||
pushFunction(L_p, "executeWidget", executeWidget);
|
||||
pushFunction(L_p, "showWidget", showWidget);
|
||||
pushFunction(L_p, "isWidgetChecked", isWidgetChecked);
|
||||
pushFunction(L_p, "isWidgetEnabled", isWidgetEnabled);
|
||||
pushFunction(L_p, "isWidgetVisible", isWidgetVisible);
|
||||
pushFunction(L_p, "getWidgetText", getWidgetText);
|
||||
pushFunction(L_p, "setWidgetChecked", setWidgetChecked);
|
||||
pushFunction(L_p, "setWidgetEnabled", setWidgetEnabled);
|
||||
|
|
@ -94,6 +96,7 @@ void LuaEngineGui::pushClass(lua_State *L_p)
|
|||
pushFunction(L_p, "setWidgetSize", setWidgetSize);
|
||||
pushFunction(L_p, "setWidgetText", setWidgetText);
|
||||
pushFunction(L_p, "setWidgetValue", setWidgetValue);
|
||||
pushFunction(L_p, "setWidgetVisible", setWidgetVisible);
|
||||
pushFunction(L_p, "widgetAddText", widgetAddText);
|
||||
pushVariant(L_p, "ShowCurrent", 0);
|
||||
pushVariant(L_p, "ShowNormal", 1);
|
||||
|
|
@ -630,6 +633,19 @@ int LuaEngineGui::setWidgetValue(lua_State *L_p)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngineGui::setWidgetVisible(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 2) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
if (pointer != NULL) {
|
||||
if (((QObject*)pointer)->inherits("QWidget")) {
|
||||
((QWidget*)pointer)->setVisible(getVariant(L_p, 2).toBool());
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngineGui::layoutAddLayout(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 2) {
|
||||
|
|
@ -1170,6 +1186,34 @@ int LuaEngineGui::isWidgetChecked(lua_State *L_p)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngineGui::isWidgetEnabled(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 1) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
if (pointer != NULL) {
|
||||
if (((QObject*)pointer)->inherits("QWidget")) {
|
||||
pushVariant(L_p, ((QWidget*)pointer)->isEnabled());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngineGui::isWidgetVisible(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 1) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
if (pointer != NULL) {
|
||||
if (((QObject*)pointer)->inherits("QWidget")) {
|
||||
pushVariant(L_p, ((QWidget*)pointer)->isVisible());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngineGui::getWindow(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue