Clutter.Model¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Whether the model has a filter |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
|
The |
|
The |
|
The |
|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Clutter.Model(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
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 setvalues ([
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:
- Return type:
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:
- Return type:
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:
func (
Clutter.ModelForeachFunc
) – aClutter.ModelForeachFunc
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:
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:
Retrieves the type of the column.
New in version 0.6.
Deprecated since version 1.24: Use
Gio.ListModel
instead
- get_filter_set()¶
-
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
. CallGObject.Object.unref
() when done using it- Return type:
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
, orNone
if row was out of bounds. When done using the iterator object, callGObject.Object.unref
() to deallocate its resources- Return type:
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
. CallGObject.Object.unref
() when done using it- Return type:
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:
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:
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:
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 modifycolumn (
int
) – column to modifyvalue (
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 indexcolumns ([
int
]) – a vector containing the columns to setvalues ([
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 setvalues ([
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:
func (
Clutter.ModelFilterFunc
orNone
) – aClutter.ModelFilterFunc
, orNone
user_data (
object
orNone
) – user data to pass to func, orNone
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 fromClutter.Model
, and should only be used when contructing aClutter.Model
. It will not work after the initial creation of theClutter.Model
.New in version 0.6.
Deprecated since version 1.24: Use
Gio.ListModel
instead
- set_sort(column, func, *user_data)¶
- Parameters:
column (
int
) – the column to sort onfunc (
Clutter.ModelSortFunc
orNone
) – aClutter.ModelSortFunc
, orNone
user_data (
object
orNone
) – user data to pass to func, orNone
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 ofGObject.GType
types
Sets the types of the columns inside a
Clutter.Model
.This function is meant primarily for
GObject.Objects
that inherit fromClutter.Model
, and should only be used when contructing aClutter.Model
. It will not work after the initial creation of theClutter.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:
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:
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
, orNone
if row was out of bounds. When done using the iterator object, callGObject.Object.unref
() to deallocate its resources- Return type:
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:
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:
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_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:
- Parameters:
model (
Clutter.Model
) – The object which received the signal
The
::filter-changed
signal is emitted when a new filter has been appliedNew 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:
- Parameters:
model (
Clutter.Model
) – The object which received the signaliter (
Clutter.ModelIter
) – aClutter.ModelIter
pointing to the new row
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:
- Parameters:
model (
Clutter.Model
) – The object which received the signaliter (
Clutter.ModelIter
) – aClutter.ModelIter
pointing to the changed row
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:
- Parameters:
model (
Clutter.Model
) – The object which received the signaliter (
Clutter.ModelIter
) – aClutter.ModelIter
pointing to the removed row
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:
- Parameters:
model (
Clutter.Model
) – The object which received the signal
The
::sort-changed
signal is emitted after the model has been sortedNew in version 0.6.
Deprecated since version 1.24: Use
Gio.ListModel
instead
Property Details¶
- Clutter.Model.props.filter_set¶
-
Whether the
Clutter.Model
has a filter setThis property is set to
True
if a filter function has been set usingClutter.Model.set_filter
()New in version 1.0.
Deprecated since version 1.24: Use
Gio.ListModel
instead