Gtk.FlattenListModel

g GObject.GInterface GObject.GInterface Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel Gtk.SectionModel Gtk.SectionModel GObject.GInterface->Gtk.SectionModel GObject.Object GObject.Object Gtk.FlattenListModel Gtk.FlattenListModel GObject.Object->Gtk.FlattenListModel Gio.ListModel->Gtk.FlattenListModel Gtk.SectionModel->Gtk.FlattenListModel

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.ListModel (4), Gtk.SectionModel (2)

Structs:

GObject.ObjectClass (5)

class

new (model)

get_model ()

get_model_for_item (position)

set_model (model)

Virtual Methods

Inherited:

GObject.Object (7), Gio.ListModel (3), Gtk.SectionModel (1)

Properties

Name

Type

Flags

Short Description

item-type

GObject.GType

r

model

Gio.ListModel

r/w/en

n-items

int

r

Signals

Inherited:

GObject.Object (1), Gio.ListModel (1), Gtk.SectionModel (1)

Fields

Inherited:

GObject.Object (1), Gio.ListModel (1), Gtk.SectionModel (1)

Class Details

class Gtk.FlattenListModel(**kwargs)
Bases:

GObject.Object, Gio.ListModel, Gtk.SectionModel

Abstract:

No

Structure:

Gtk.FlattenListModelClass

GtkFlattenListModel is a list model that concatenates other list models.

GtkFlattenListModel takes a list model containing list models, and flattens it into a single model. Each list model becomes a section in the single model.

classmethod new(model)[source]
Parameters:

model (Gio.ListModel or None) – the model to be flattened

Returns:

a new GtkFlattenListModel

Return type:

Gtk.FlattenListModel

Creates a new GtkFlattenListModel that flattens list.

get_model()[source]
Returns:

The model flattened by self

Return type:

Gio.ListModel or None

Gets the model set via Gtk.FlattenListModel.set_model().

get_model_for_item(position)[source]
Parameters:

position (int) – a position

Returns:

the model containing the item at position

Return type:

Gio.ListModel or None

Returns the model containing the item at the given position.

set_model(model)[source]
Parameters:

model (Gio.ListModel or None) – the new model

Sets a new model to be flattened.

Property Details

Gtk.FlattenListModel.props.item_type
Name:

item-type

Type:

GObject.GType

Default Value:

<GType GObject>

Flags:

READABLE

The type of items. See [method`Gio`.ListModel.get_item_type].

New in version 4.8.

Gtk.FlattenListModel.props.model
Name:

model

Type:

Gio.ListModel

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The model being flattened.

Gtk.FlattenListModel.props.n_items
Name:

n-items

Type:

int

Default Value:

0

Flags:

READABLE

The number of items. See [method`Gio`.ListModel.get_n_items].

New in version 4.8.