support getObjectText for LEListWidgetItem

This commit is contained in:
Syping 2020-05-19 21:02:41 +02:00
parent fcabd1685d
commit 7449286a20

View file

@ -1513,7 +1513,11 @@ int LuaEngineGui::getObjectText(lua_State *L_p)
if (getArgumentCount(L_p) >= 1) { if (getArgumentCount(L_p) >= 1) {
void *pointer = getPointer(L_p, 1); void *pointer = getPointer(L_p, 1);
if (pointer != NULL) { if (pointer != NULL) {
if (((QObject*)pointer)->inherits("QAction")) { if (((QObject*)pointer)->inherits("LEListWidgetItem")) {
pushVariant(L_p, ((LEListWidgetItem*)pointer)->item()->text());
return 1;
}
else if (((QObject*)pointer)->inherits("QAction")) {
pushVariant(L_p, ((QAction*)pointer)->text()); pushVariant(L_p, ((QAction*)pointer)->text());
return 1; return 1;
} }