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.

Members  

Inherited members  

  • 38 members inherited from Item

Types  

Functions  

Protected functions  

Members detail  

ListItem()  

No documentation available

~ListItem()  

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.

typedef Ref<const ListItem, ListItem> const_ptr  

Shortcut for Ref smart pointer class to ListItem type provided for convenience

Item::ptr get_child(const String &name) const  

Find a child item from name.

virtual int get_child_count() const  

This virtual function overrides the get_child_count virtual function defined in the Item base class.

Get number of childs

virtual int get_column_count() const  

This member access is protected.

Must return columns count for children of this node, default implementation returns 1.

const QList<Item::ptr> & get_list() const  

Get child items list

virtual bool meta_contains(State &ls, const Value &key)  

This virtual function overrides the meta_contains virtual function defined in the UserData base class.

Documentation inherited from base class:

This function returns true if either the Value::OpIndex operation or the Value::OpNewindex operation is supported and an entry is associated to the given key.

The default implementation returns !meta_index(ls, key).is_nil() or false if UserData::meta_index throws.

virtual Value meta_index(State &ls, const Value &key)  

This virtual function overrides the meta_index virtual function defined in the UserData base class.

Documentation inherited from base class:

This function is called when a table read access operation is attempted on a userdata object. The default implementation throws an error message. The UserData::support function must be reimplemented along with this function to report Value::OpIndex as supported.

Parameters list:

  • key: Value used as table index.

The return value is Table access result value.

virtual void meta_newindex(State &ls, const Value &key, const Value &value)  

This virtual function overrides the meta_newindex virtual function defined in the UserData base class.

Documentation inherited from base class:

This function is called when a table write access operation is attempted on a userdata object. The default implementation throws an error message. The UserData::support function must be reimplemented along with this function to report Value::OpNewindex as supported.

Parameters list:

  • key: Value used as table index.
  • value: Value to put in table.

virtual Value meta_operation(State &ls, Value::Operation op, const Value &a, const Value &b)  

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 must 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.

virtual Iterator::ptr new_iterator(State &ls)  

This virtual function overrides the new_iterator virtual function defined in the UserData base class.

Documentation inherited from base class:

This function may return an Iterator object used to iterate over an userdata object. The default implementation throws an error message. The UserData::support function must be reimplemented along with this function to report Value::OpIterate as supported.

The return value is an Iterator based iterator object.

typedef Ref<ListItem, ListItem> ptr  

Shortcut for Ref smart pointer class to ListItem type provided for convenience

virtual bool support(Value::Operation c) const  

This virtual function overrides the support virtual function defined in the UserData base class.

Documentation inherited from base class:

Check given operation support.

See also Value::support function.

Valid XHTML 1.0 StrictGenerated by diaxen on Sun Jan 8 22:46:02 2012 using MkDoc