Gda.DataModelIter

g GObject.Object GObject.Object Gda.Set Gda.Set GObject.Object->Gda.Set Gda.DataModelIter Gda.DataModelIter Gda.Set->Gda.DataModelIter

Subclasses:

None

Methods

Inherited:

Gda.Set (18), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

error_quark ()

get_column_for_param (param)

get_holder_for_field (col)

get_row ()

get_value_at (col)

get_value_at_e (col)

get_value_for_field (field_name)

invalidate_contents ()

is_valid ()

move_next ()

move_prev ()

move_to_row (row)

set_value_at (col, value)

Virtual Methods

Inherited:

Gda.Set (7), GObject.Object (7)

do_end_of_data ()

do_row_changed (row)

Properties

Inherited:

Gda.Set (5)

Name

Type

Flags

Short Description

current-row

int

r/w

Current represented row in the data model

data-model

Gda.DataModel

r/w/c

Data model for which the iter is for

forced-model

Gda.DataModel

r/w

Overrides the data model the iter is attached to (reserved for internal usage)

update-model

bool

r/w

Signals

Inherited:

Gda.Set (7), GObject.Object (1)

Name

Short Description

end-of-data

Gets emitted when iter has reached the end of available data (which means the previous row it was on was the last one).

row-changed

Gets emitted when the row iter is currently pointing has changed

Fields

Inherited:

Gda.Set (7), GObject.Object (1)

Name

Type

Access

Description

object

Gda.Set

r

Class Details

class Gda.DataModelIter(**kwargs)
Bases:

Gda.Set

Abstract:

No

Structure:

Gda.DataModelIterClass

classmethod error_quark()
Return type:

int

get_column_for_param(param)
Parameters:

param (Gda.Holder) – a Gda.Holder object, listed in self

Returns:

the column number, or param is not valid

Return type:

int

Get the column number in the Gda.DataModel for which self is an iterator as represented by the param parameter

Deprecated since version 5.2: not very useful

get_holder_for_field(col)
Parameters:

col (int) – the requested column

Returns:

the Gda.Holder, or None if an error occurred

Return type:

Gda.Holder

Fetch a pointer to the Gda.Holder object which is synchronized with data at column col

get_row()
Returns:

the row number, or -1 if self is invalid

Return type:

int

Get the row which self represents in the data model

get_value_at(col)
Parameters:

col (int) – the requested column

Returns:

the GObject.Value, or None if the value could not be fetched

Return type:

GObject.Value or None

Get the value stored at the column col in self. The returned value must not be modified.

get_value_at_e(col)
Parameters:

col (int) – the requested column

Raises:

GLib.Error

Returns:

the GObject.Value, or None if the value could not be fetched

Return type:

GObject.Value or None

Get the value stored at the column col in self. The returned value must not be modified.

New in version 4.2.10.

get_value_for_field(field_name)
Parameters:

field_name (str) – the requested column name

Returns:

the GObject.Value, or None

Return type:

GObject.Value or None

Get the value stored at the column field_name in self

invalidate_contents()

Declare all the parameters in self invalid, without modifying the Gda.DataModel self is for or changing the row it represents. This method is for internal usage. Note that for Gda.DataModelIter.is_valid() to return False, it is also necessary to set the “current-row” property to -1.

is_valid()
Returns:

True if self is valid

Return type:

bool

Tells if self is a valid iterator (if it actually corresponds to a valid row in the model)

move_next()
Returns:

True if the iterator is now at the next row

Return type:

bool

Moves self one row further than where it already is (synchronizes the values of the parameters in self with the values at the new row).

If the iterator was on the data model’s last row, then it can’t be moved forward anymore, and the returned value is False; note also that the “current-row” property is set to -1 (which means that Gda.DataModelIter.is_valid() would return False)

This function can return False if it was not allowed to be moved (as it emits the “validate-set” signal before being moved).

When this function returns True, then self has actually been moved to the next row, but some values may not have been read correctly in the row, in which case the correcsponding Gda.Holder will be left invalid.

move_prev()
Returns:

True if the iterator is now at the previous row

Return type:

bool

Moves self one row before where it already is (synchronizes the values of the parameters in self with the values at the new row).

If the iterator was on the data model’s first row, then it can’t be moved backwards anymore, and the returned value is False; note also that the “current-row” property is set to -1 (which means that Gda.DataModelIter.is_valid() would return False).

This function can return False if it was not allowed to be moved (as it emits the “validate-set” signal before being moved).

When this function returns True, then self has actually been moved to the next row, but some values may not have been read correctly in the row, in which case the correcsponding Gda.Holder will be left invalid.

move_to_row(row)
Parameters:

row (int) – the row to set self to

Returns:

True if no error occurred

Return type:

bool

Synchronizes the values of the parameters in self with the values at the row row.

If row is not a valid row, then the returned value is False, and the “current-row” property is set to -1 (which means that Gda.DataModelIter.is_valid() would return False), with the exception that if row is -1, then the returned value is True.

This function can return False if it was not allowed to be moved (as it emits the “validate-set” signal before being moved).

When this function returns True, then self has actually been moved to the next row, but some values may not have been read correctly in the row, in which case the correcsponding Gda.Holder will be left invalid.

set_value_at(col, value)
Parameters:
Raises:

GLib.Error

Returns:

True if no error occurred

Return type:

bool

Sets a value in self, at the column specified by col

do_end_of_data() virtual
do_row_changed(row) virtual
Parameters:

row (int) –

Signal Details

Gda.DataModelIter.signals.end_of_data(data_model_iter)
Signal Name:

end-of-data

Flags:

RUN_FIRST

Parameters:

data_model_iter (Gda.DataModelIter) – The object which received the signal

Gets emitted when iter has reached the end of available data (which means the previous row it was on was the last one).

Gda.DataModelIter.signals.row_changed(data_model_iter, row)
Signal Name:

row-changed

Flags:

RUN_FIRST

Parameters:
  • data_model_iter (Gda.DataModelIter) – The object which received the signal

  • row (int) – the new iter’s row

Gets emitted when the row iter is currently pointing has changed

Property Details

Gda.DataModelIter.props.current_row
Name:

current-row

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

Current represented row in the data model

Gda.DataModelIter.props.data_model
Name:

data-model

Type:

Gda.DataModel

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

Data model for which the iter is for

Gda.DataModelIter.props.forced_model
Name:

forced-model

Type:

Gda.DataModel

Default Value:

None

Flags:

READABLE, WRITABLE

Overrides the data model the iter is attached to (reserved for internal usage)

Gda.DataModelIter.props.update_model
Name:

update-model

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE