Clutter.Model

g Clutter.Model Clutter.Model Clutter.Scriptable Clutter.Scriptable Clutter.Scriptable->Clutter.Model GObject.GInterface GObject.GInterface GObject.GInterface->Clutter.Scriptable GObject.Object GObject.Object GObject.Object->Clutter.Model

Subclasses:

Clutter.ListModel

Methods

Inherited:

GObject.Object (37), Clutter.Scriptable (4)

Structs:

GObject.ObjectClass (5)

appendv (columns, values)

filter_iter (iter)

filter_row (row)

foreach (func, *user_data)

get_column_name (column)

get_column_type (column)

get_filter_set ()

get_first_iter ()

get_iter_at_row (row)

get_last_iter ()

get_n_columns ()

get_n_rows ()

get_sorting_column ()

insert_value (row, column, value)

insertv (row, columns, values)

prependv (columns, values)

remove (row)

resort ()

set_filter (func, *user_data)

set_names (names)

set_sort (column, func, *user_data)

set_sorting_column (column)

set_types (types)

Virtual Methods

Inherited:

GObject.Object (7), Clutter.Scriptable (4)

do_filter_changed ()

do_get_column_name (column)

do_get_column_type (column)

do_get_iter_at_row (row)

do_get_n_columns ()

do_get_n_rows ()

do_remove_row (row)

do_row_added (iter)

do_row_changed (iter)

do_row_removed (iter)

do_sort_changed ()

Properties

Name

Type

Flags

Short Description

filter-set

bool

r

Whether the model has a filter deprecated

Signals

Inherited:

GObject.Object (1)

Name

Short Description

filter-changed

The ::filter-changed signal is emitted when a new filter has been applied deprecated

row-added

The ::row-added signal is emitted when a new row has been added. deprecated

row-changed

The ::row-removed signal is emitted when a row has been changed. deprecated

row-removed

The ::row-removed signal is emitted when a row has been removed. deprecated

sort-changed

The ::sort-changed signal is emitted after the model has been sorted deprecated

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Clutter.Model(**kwargs)
Bases:

GObject.Object, Clutter.Scriptable

Abstract:

Yes

Structure:

Clutter.ModelClass

Base class for list models. The Clutter.Model structure contains only private data and should be manipulated using the provided API.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

appendv(columns, values)
Parameters:
  • columns ([int]) – a vector with the columns to set

  • values ([GObject.Value]) – a vector with the values

Creates and appends a new row to the Clutter.Model, setting the row values for the given columns upon creation.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

filter_iter(iter)
Parameters:

iter (Clutter.ModelIter) – the row to filter

Returns:

True if the row should be displayed, False otherwise

Return type:

bool

Checks whether the row pointer by iter should be filtered or not using the filtering function set on self.

This function should be used only by subclasses of Clutter.Model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

filter_row(row)
Parameters:

row (int) – the row to filter

Returns:

True if the row should be displayed, False otherwise

Return type:

bool

Checks whether row should be filtered or not using the filtering function set on self.

This function should be used only by subclasses of Clutter.Model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

foreach(func, *user_data)
Parameters:

Calls func for each row in the model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_column_name(column)
Parameters:

column (int) – the column number

Returns:

the name of the column. The model holds the returned string, and it should not be modified or freed

Return type:

str

Retrieves the name of the column

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_column_type(column)
Parameters:

column (int) – the column number

Returns:

the type of the column.

Return type:

GObject.GType

Retrieves the type of the column.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_filter_set()
Returns:

True if a filter is set

Return type:

bool

Returns whether the self has a filter in place, set using Clutter.Model.set_filter()

New in version 1.0.

Deprecated since version 1.24: Use Gio.ListModel instead

get_first_iter()
Returns:

A new Clutter.ModelIter. Call GObject.Object.unref() when done using it

Return type:

Clutter.ModelIter

Retrieves a Clutter.ModelIter representing the first non-filtered row in self.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_iter_at_row(row)
Parameters:

row (int) – position of the row to retrieve

Returns:

A new Clutter.ModelIter, or None if row was out of bounds. When done using the iterator object, call GObject.Object.unref() to deallocate its resources

Return type:

Clutter.ModelIter

Retrieves a Clutter.ModelIter representing the row at the given index.

If a filter function has been set using Clutter.Model.set_filter() then the self implementation will return the first non filtered row.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_last_iter()
Returns:

A new Clutter.ModelIter. Call GObject.Object.unref() when done using it

Return type:

Clutter.ModelIter

Retrieves a Clutter.ModelIter representing the last non-filtered row in self.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_n_columns()
Returns:

the number of columns

Return type:

int

Retrieves the number of columns inside self.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_n_rows()
Returns:

The length of the self. If there is a filter set, then the length of the filtered self is returned.

Return type:

int

Retrieves the number of rows inside self, eventually taking into account any filtering function set using Clutter.Model.set_filter().

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

get_sorting_column()
Returns:

a column number, or -1 if the model is not sorted

Return type:

int

Retrieves the number of column used for sorting the self.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

insert_value(row, column, value)
Parameters:
  • row (int) – position of the row to modify

  • column (int) – column to modify

  • value (GObject.Value) – new value for the cell

Sets the data in the cell specified by iter and column. The type of value must be convertable to the type of the column. If the row does not exist then it is created.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

insertv(row, columns, values)
Parameters:
  • row (int) – row index

  • columns ([int]) – a vector containing the columns to set

  • values ([GObject.Value]) – a vector containing the values for the cells

Inserts data at row into the Clutter.Model, setting the row values for the given columns upon creation.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

prependv(columns, values)
Parameters:
  • columns ([int]) – a vector containing the columns to set

  • values ([GObject.Value]) – a vector containing the values for the cells

Creates and prepends a new row to the Clutter.Model, setting the row values for the given columns upon creation.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

remove(row)
Parameters:

row (int) – position of row to remove

Removes the row at the given position from the model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

resort()

Force a resort on the self. This function should only be used by subclasses of Clutter.Model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

set_filter(func, *user_data)
Parameters:

Filters the self using the given filtering function.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

set_names(names)
Parameters:

names ([str]) – an array of strings

Assigns a name to the columns of a Clutter.Model.

This function is meant primarily for GObject.Objects that inherit from Clutter.Model, and should only be used when contructing a Clutter.Model. It will not work after the initial creation of the Clutter.Model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

set_sort(column, func, *user_data)
Parameters:

Sorts self using the given sorting function.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

set_sorting_column(column)
Parameters:

column (int) – the column of the self to sort, or -1

Sets the model to sort by column. If column is a negative value the sorting column will be unset.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

set_types(types)
Parameters:

types ([GObject.GType]) – an array of GObject.GType types

Sets the types of the columns inside a Clutter.Model.

This function is meant primarily for GObject.Objects that inherit from Clutter.Model, and should only be used when contructing a Clutter.Model. It will not work after the initial creation of the Clutter.Model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

do_filter_changed() virtual
do_get_column_name(column) virtual
Parameters:

column (int) – the column number

Returns:

the name of the column. The model holds the returned string, and it should not be modified or freed

Return type:

str

Retrieves the name of the column

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

do_get_column_type(column) virtual
Parameters:

column (int) – the column number

Returns:

the type of the column.

Return type:

GObject.GType

Retrieves the type of the column.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

do_get_iter_at_row(row) virtual
Parameters:

row (int) – position of the row to retrieve

Returns:

A new Clutter.ModelIter, or None if row was out of bounds. When done using the iterator object, call GObject.Object.unref() to deallocate its resources

Return type:

Clutter.ModelIter

Retrieves a Clutter.ModelIter representing the row at the given index.

If a filter function has been set using Clutter.Model.set_filter() then the model implementation will return the first non filtered row.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

do_get_n_columns() virtual
Returns:

the number of columns

Return type:

int

Retrieves the number of columns inside model.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

do_get_n_rows() virtual
Returns:

The length of the model. If there is a filter set, then the length of the filtered model is returned.

Return type:

int

Retrieves the number of rows inside model, eventually taking into account any filtering function set using Clutter.Model.set_filter().

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

do_remove_row(row) virtual
Parameters:

row (int) –

do_row_added(iter) virtual
Parameters:

iter (Clutter.ModelIter) –

do_row_changed(iter) virtual
Parameters:

iter (Clutter.ModelIter) –

do_row_removed(iter) virtual
Parameters:

iter (Clutter.ModelIter) –

do_sort_changed() virtual

Signal Details

Clutter.Model.signals.filter_changed(model)
Signal Name:

filter-changed

Flags:

RUN_LAST

Parameters:

model (Clutter.Model) – The object which received the signal

The ::filter-changed signal is emitted when a new filter has been applied

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

Clutter.Model.signals.row_added(model, iter)
Signal Name:

row-added

Flags:

RUN_LAST

Parameters:

The ::row-added signal is emitted when a new row has been added. The data on the row has already been set when the ::row-added signal has been emitted.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

Clutter.Model.signals.row_changed(model, iter)
Signal Name:

row-changed

Flags:

RUN_LAST

Parameters:

The ::row-removed signal is emitted when a row has been changed. The data on the row has already been updated when the ::row-changed signal has been emitted.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

Clutter.Model.signals.row_removed(model, iter)
Signal Name:

row-removed

Flags:

RUN_LAST

Parameters:

The ::row-removed signal is emitted when a row has been removed. The data on the row pointed by the passed iterator is still valid when the ::row-removed signal has been emitted.

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

Clutter.Model.signals.sort_changed(model)
Signal Name:

sort-changed

Flags:

RUN_LAST

Parameters:

model (Clutter.Model) – The object which received the signal

The ::sort-changed signal is emitted after the model has been sorted

New in version 0.6.

Deprecated since version 1.24: Use Gio.ListModel instead

Property Details

Clutter.Model.props.filter_set
Name:

filter-set

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the Clutter.Model has a filter set

This property is set to True if a filter function has been set using Clutter.Model.set_filter()

New in version 1.0.

Deprecated since version 1.24: Use Gio.ListModel instead