[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libqtlua-list] Iterating over a UserData object

From: Nenad Lakinski
Subject: [Libqtlua-list] Iterating over a UserData object
Date: Fri, 1 Apr 2016 07:49:55 -0700


I subclassed UserData and created a new C++ class that implements: meta_operation, get_value_str, meta_index, meta_contains, new_iterator & support.

However for some reason I can't use this userdata object for iteration. When I try with ipairs/pairs I get an error message saying that the object must be a table. When I try with each/list it treats the UserData object as empty.

The # and [] operations do work however and my code gets called correctly.

I am returning OpIterator from support, however I attached a debugger and I can se that new_iterator and support are never called.

The UserData class is declared as QTLUA_REFTYPE and I tried a number of different ways of passing it to the Lua state, all with the same result.

I'm wondering if I'm missing something here. I went over all the other UserData classes in the codebase (e.g. the proxies) and I can't see any difference between those and my class.

Any help would be greatly appreciated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]