diff options
Diffstat (limited to 'client/widgets/lineedit.h')
-rw-r--r-- | client/widgets/lineedit.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/client/widgets/lineedit.h b/client/widgets/lineedit.h index 8159aad..6ddb9af 100644 --- a/client/widgets/lineedit.h +++ b/client/widgets/lineedit.h @@ -64,4 +64,27 @@ private: QStringList suggestions; }; +int lin_clear_suggestions(lua_State *L); +int lin_show_suggestions(lua_State *L); +int lin_is_suggested(lua_State *L); +int lin_add_suggestion(lua_State *L); + +#define LINEDT_METHS \ + {"clearSuggestions", lin_clear_suggestions}, \ + {"showSuggestions", lin_show_suggestions},\ + {"isSuggested", lin_is_suggested},\ + {"addSuggestion", lin_add_suggestion} + +const struct luaL_Reg linedt_meths[] = + { WDG_METHS, LINEDT_METHS, {NULL, NULL} }; + +inline void register_lineedit(lua_State *L) +{ + luaL_newmetatable(L, "LineEdit"); + lua_pushliteral(L, "__index"); + lua_pushvalue(L, -2); + lua_rawset(L, -3); + luaL_register(L, NULL, linedt_meths); +} + #endif/*__PRACRO_LINEEDIT_H__*/ |