UserListItem class reference
[Model/View module]
Declaration
#include <QtLua/UserListItem>
namespace QtLua {
class UserListItem;
};
This class is a member of the QtLua namespace.
This class is declared in QtLua/qtluauserlistitem.hh source file, line 52.
Description
This class together with the UserItem and UserItemModel 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.
UserListItem objects are UserItem objects with pointer list to children objects. They can be accessed as tables from lua script.
See UserItemModel for example.
Members
Inherited members
- 57 members inherited from UserItem
Types
Functions
- UserListItem()
- ~UserListItem()
- Ref<UserItem> get_child(const String &name) const
- virtual int get_child_count() const
- const QList<Ref<UserItem>> & get_list() const
- virtual bool meta_contains(State *ls, const Value &key)
- virtual Value meta_index(State *ls, const Value &key)
- virtual void meta_newindex(State *ls, const Value &key, const Value &value)
- virtual Value meta_operation(State *ls, ValueBase::Operation op, const Value &a, const Value &b)
- virtual Ref<Iterator> new_iterator(State *ls)
- virtual bool support(ValueBase::Operation c) const
Protected functions
- virtual bool accept_child(const Ref<UserItem> &item) const
- virtual void child_changed()
- virtual String default_child_name(int row) const
- virtual int get_column_count() const
Private functions
- void change_indexes(int first)
- virtual void completion_patch(String &path, String &entry, int &offset)
- void insert_child(UserItem *item, int row)
- void insert_name(UserItem *item, int row)
- void remove_child(UserItem *item)
- void remove_name(UserItem *item)
- virtual void set_model(UserItemModel *model)
Private fields
- QHash<String, UserItem*> _child_hash
- QList<Ref<UserItem>> _child_list
- int _id_counter
Members detail
This constructor is declared in QtLua/qtluauserlistitem.hh source file, line 60.
This destructor is declared in QtLua/qtluauserlistitem.hh source file, line 61.
This variable is declared in QtLua/qtluauserlistitem.hh source file, line 112.
This member access is private.
This variable is declared in QtLua/qtluauserlistitem.hh source file, line 113.
This member access is private.
This variable is declared in QtLua/qtluauserlistitem.hh source file, line 114.
This member access is private.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 87.
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.
This function is declared in QtLua/qtluauserlistitem.hh source file, line 106.
This member access is private.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 94.
This member access is protected.
This function is called when a child is added, removed or changes name. Default implementation does nothing.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 102.
This member access is private.
This virtual function overrides the completion_patch
virtual function defined in the UserData
base class.
Documentation inherited from base class:
This function may be reimplemented to further modify completion result on console line when completed to a UserData value. This is usefull to append a dot or a pair of brackets access operator to the userdata value name for instance.
Parameters list:
- path: Completion result tables path to userdata value.
- entry: Completion result userdata name. May append to this string directly.
- offset: Cursor offset. May be decreased to place cursor between inserted brackets for instance.
typedef Ref<const UserListItem, UserListItem> const_ptr
This typedef is declared in QTLUA_REFTYPE function like macro expansion, line 3 in QtLua/qtluauserlistitem.hh source file, line 58.
Shortcut for Ref smart pointer class to UserListItem type provided for convenience
virtual String default_child_name(int row) const
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 98.
This member access is protected.
This function returns default name of the child item used when first inserted if not already set.
This function is declared in QtLua/qtluauserlistitem.hh source file, line 64.
Find a child item from name.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 70.
This virtual function overrides the get_child_count
virtual function defined in the UserItem
base class.
Get number of childs
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 90.
This member access is protected.
Must return columns count for children of this node, default implementation returns 1.
This function is declared in QtLua/qtluauserlistitem.hh source file, line 67.
Get child items list
void insert_child(UserItem *item, int row)
This function is declared in QtLua/qtluauserlistitem.hh source file, line 107.
This member access is private.
void insert_name(UserItem *item, int row)
This function is declared in QtLua/qtluauserlistitem.hh source file, line 108.
This member access is private.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 76.
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 ValueBase::OpIndex operation or the ValueBase::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.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 75.
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 ValueBase::OpIndex as supported.
Parameters list:
- key: Value used as table index.
The return value is Table access result value.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 74.
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 ValueBase::OpNewindex as supported.
Parameters list:
- key: Value used as table index.
- value: Value to put in table.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 72.
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 ValueBase::Operation).
- a: First value involved in operation.
- b: Second value involved in operation for binary operators.
The return value is Operation result value.
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 77.
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 ValueBase::OpIterate as supported.
The return value is an Iterator based iterator object.
typedef Ref<UserListItem, UserListItem> ptr
This typedef is declared in QTLUA_REFTYPE function like macro expansion, line 5 in QtLua/qtluauserlistitem.hh source file, line 58.
Shortcut for Ref smart pointer class to UserListItem type provided for convenience
void remove_child(UserItem *item)
This function is declared in QtLua/qtluauserlistitem.hh source file, line 109.
This member access is private.
void remove_name(UserItem *item)
This function is declared in QtLua/qtluauserlistitem.hh source file, line 110.
This member access is private.
virtual void set_model(UserItemModel *model)
This virtual function is declared in QtLua/qtluauserlistitem.hh source file, line 104.
This member access is private.
This virtual function overrides the set_model
virtual function defined in the UserItem
base class.