fix createWidgetStack argument parsing

This commit is contained in:
Syping 2020-05-16 20:02:20 +02:00
parent 4c01f31b04
commit 5343818dd4

View file

@ -1188,8 +1188,8 @@ int LuaEngineGui::createToolButton(lua_State *L_p)
int LuaEngineGui::createWidgetStack(lua_State *L_p) int LuaEngineGui::createWidgetStack(lua_State *L_p)
{ {
if (getArgumentCount(L_p) >= 2) { if (getArgumentCount(L_p) >= 1) {
void *pointer = getPointer(L_p, 2); void *pointer = getPointer(L_p, 1);
if (pointer != NULL && ((QObject*)pointer)->inherits("QStackedWidget")) { if (pointer != NULL && ((QObject*)pointer)->inherits("QStackedWidget")) {
QStackedWidget *stackedWidget = (QStackedWidget*)pointer; QStackedWidget *stackedWidget = (QStackedWidget*)pointer;
QWidget *widgetStack = new QWidget(stackedWidget); QWidget *widgetStack = new QWidget(stackedWidget);