## GtkFlattenListModel GtkFlattenListModel — A list model that flattens a list of lists |

## Functions

GtkFlattenListModel * | gtk_flatten_list_model_new ()
void | gtk_flatten_list_model_set_model ()
GListModel * | gtk_flatten_list_model_get_model ()
GListModel * | gtk_flatten_list_model_get_model_for_item ()

## Properties

GType * | item-type | Read / Write / Construct Only
GListModel * | model | Read / Write

## Types and Values

| GtkFlattenListModel

## Object Hierarchy

        GObject
        ╰── GtkFlattenListModel

## Implemented Interfaces

GtkFlattenListModel implements GListModel.

## Includes

    #include <gtk/gtk.h>

## Description

GtkFlattenListModel is a list model that takes a list model containing list models and flattens it into a single model.

Another term for this is concatenation: GtkFlattenListModel takes a list of lists and concatenates them into a single list.

## Functions

### gtk_flatten_list_model_new ()

    GtkFlattenListModel *
    gtk_flatten_list_model_new (GType item_type,
                                GListModel *model);

Creates a new GtkFlattenListModel that flattens `list` . The models returned by `model` must conform to the given `item_type` , either by having an identical type or a subtype.

#### Parameters

item_type | The type of items in the to-be-flattened models |
model | the item to be flattened. | [nullable][transfer none]

#### Returns

a new GtkFlattenListModel

### gtk_flatten_list_model_set_model ()

    void
    gtk_flatten_list_model_set_model (GtkFlattenListModel *self,
                                      GListModel *model);

Sets a new model to be flattened. The model must contain items of GListModel that conform to the item type of `self` .

#### Parameters

self | a GtkFlattenListModel |
model | the new model or `NULL`. | [nullable][transfer none]

### gtk_flatten_list_model_get_model ()

    GListModel *
    gtk_flatten_list_model_get_model (GtkFlattenListModel *self);

Gets the model set via `gtk_flatten_list_model_set_model()`.

#### Parameters

self | a GtkFlattenListModel |

#### Returns

The model flattened by `self` .

[nullable][transfer none]

### gtk_flatten_list_model_get_model_for_item ()

    GListModel *
    gtk_flatten_list_model_get_model_for_item
                                   (GtkFlattenListModel *self,
                                    guint position);

Returns the model containing the item at the given position.

#### Parameters

self | a GtkFlattenListModel |
position | a position |

#### Returns

the model containing the item at `position` .

[transfer none]

## Types and Values

### GtkFlattenListModel

    typedef struct _GtkFlattenListModel GtkFlattenListModel;

## Property Details

### The `“item-type”` property

      “item-type”                GType *

The GType for elements of this object

Owner: GtkFlattenListModel

Flags: Read / Write / Construct Only

Allowed values: GObject

### The `“model”` property

      “model”                    GListModel *

The model being flattened

Owner: GtkFlattenListModel

Flags: Read / Write

## See Also

GListModel