diff options
author | deva <deva> | 2011-06-28 06:38:10 +0000 |
---|---|---|
committer | deva <deva> | 2011-06-28 06:38:10 +0000 |
commit | 6389aabffe198ece92b58ae34a905902c7eefe7c (patch) | |
tree | cfda4b340e462e5193f4ac2e6814cce5d707ca4f /client/widgets/lineedit.h | |
parent | 01febc40e2aad29bf6cf6cbeb457c44354aba0f9 (diff) |
Complete rewrite of the way lua widget methods, 'inheritance' in particular, are handled.
Diffstat (limited to 'client/widgets/lineedit.h')
-rw-r--r-- | client/widgets/lineedit.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/client/widgets/lineedit.h b/client/widgets/lineedit.h index e76fe74..08230a6 100644 --- a/client/widgets/lineedit.h +++ b/client/widgets/lineedit.h @@ -31,11 +31,17 @@ #include "widget.h" +#ifdef LUA_CLASS +#undef LUA_CLASS +#endif +#define LUA_CLASS "LineEdit" + /*** * Line Edit Widget * @tag lineedit + * @screenshot Example + * <lineedit name="myname" value="some text"/> * @extends widget - * @screenshot * The lineedit is a single line textual input field. * @example Simple example of usage: * <lineedit name="myname" value="some text"/> @@ -55,6 +61,8 @@ public: LineEdit(QDomNode &node, MacroWindow *macrowindow); ~LineEdit(); + virtual QString luaclass() { return LUA_CLASS; } + QString value(); void setValue(QString value, QString source); @@ -135,7 +143,7 @@ const struct luaL_Reg linedt_meths[] = inline void register_lineedit(lua_State *L) { - luaL_newmetatable(L, "LineEdit"); + luaL_newmetatable(L, LUA_CLASS); lua_pushliteral(L, "__index"); lua_pushvalue(L, -2); lua_rawset(L, -3); |