类
郭思列表存储
描述 [源]
final class Gio.ListStore : GObject.Object
implements Gio.ListModel {
/* No available fields */
}
GListStore是一个简单的GListModel实现,将所有条目存储在内存中。
它通过快速路径对迭代列表的公共情况进行线性迭代,以对插入、删除和查找提供对数时间复杂度。
实例方法
g_list_store_find_with_equal_func
通过遍历项目并与equal_func比较它们来查找列表存储中的给定item。如果找到匹配的item,则停止比较。如果未找到item,则不设置position,并且此方法将返回FALSE。
since: 2.64
g_list_store_find_with_equal_func_full
类似于g_list_store_find_with_equal_func(),但有一个额外的user_data作为参数传递给equal_func。
since: 2.74
g_list_store_insert
将item插入到store的position处。item必须类型为GListStore:item-type或派生自它。 position必须小于列表长度,或者等于它以添加。
since: 2.44
g_list_store_splice
通过删除n_removals个项目并添加n_additions个项目来更改store。additions必须包含类型为GListStore:item-type的n_additions个项目。NULL不允许。
since: 2.44
从GListModel继承的方法(5)
g_list_model_get_item
获取position处的项目。
since: 2.44
g_list_model_get_item_type
获取列表中项目的类型。
since: 2.44
g_list_model_get_n_items
获取列表中的项目数。
since: 2.44
g_list_model_get_object
获取position处的项目。
since: 2.44
g_list_model_items_changed
在 list 上发出 GListModel::items-changed 信号。
since: 2.44
信号
从 GObject 继承的信号(1)
GObject::notify
当一个对象的属性值通过 g_object_set_property(), g_object_set() 等方法被设置时,会发出 notify 信号。
从 GListModel 继承的信号(1)
GListModel::items-changed
每当向 list 添加或删除项目时,都会发出此信号。在 position 位置,删除了 removed 项目,并在其位置添加了 added 项目。
since: 2.44