ListItem class reference
[Model/View module]
Declaration
#include <QtLua/ListItem>
namespace QtLua {
class ListItem;
};
This class is a member of the QtLua namespace.
Description
This class together with the Item and ItemModel classes enable easy use of list or hierarchical data structures that can be viewed and modified from lua script, Qt view widgets and C++ code.
ListItem objects are Item objects with pointer list to children objects. It can be accessed as tables from lua script.
See ItemModel for example.
Inheritance
Members
Inherited members
- 32 members inherited from Item
Types
Functions
- ListItem()
- ~ListItem()
- Item::ptr get_child(const String &name) const
- virtual int get_child_count() const
- const QList<Item::ptr> & get_list() const
Protected functions
- virtual bool accept_child(const Item::ptr &item) const
- virtual Value meta_operation(State &ls, Value::Operation op, const Value &a, const Value &b)
- virtual bool support(Value::Operation c) const
Members detail
No documentation available
No documentation available
virtual bool accept_child(const Item::ptr &item) const
This member access is protected.
This function can be reimplemented to allow or deny items membership when inserted from lua script or Qt view.
The return value is true if item is allowed to be a child member.
Shortcut for Ref smart pointer class to ListItem type provided for convenience
Find a child item from name.
This virtual function overrides the get_child_count
virtual function defined in the Item
base class.
Get number of childs
Get child items list
This member access is protected.
This virtual function overrides the meta_operation
virtual function defined in the UserData
base class.
Documentation inherited from base class:
This function is called when a lua operator is used with a UserData object. The default implementation throws an error message. The UserData::support function should be reimplemented along with this function.
Parameters list:
- op: Specify invoked lua operator (see Value::Operation).
- a: First value involved in operation.
- b: Second value involved in operation for binary operators.
The return value is Operation result value.
Shortcut for Ref smart pointer class to ListItem type provided for convenience