TYPE* luaQ_optqobject<TYPE>(lua_State *L, int index, TYPE *d)

Returns the optional Qt object of type TYPE found at position index in the stack. If the position corresponds to an unspecified function argument, this function returns d. If the Lua value at this position is not a Qt object of the requested type, this function causes an error.

See also luaQ_checkqobject