gtkmm: Gtk::TreeConstRow Class Reference

gtkmm 4.22.0

Public Member Functions | List of all members
Gtk::TreeConstRow Class Reference
TreeView Classes

Typedefed as TreeModel::ConstRow. More...

`#include <gtkmm/treeiter.h>`

Inheritance diagram for Gtk::TreeConstRow:
[legend]

## Public Member Functions
template<typename ColumnType>
const TreeValueProxy< TreeConstRow, ColumnType > | operator[] (const TreeModelColumn< ColumnType > & column) const
| Use this to get the value of this column of this row.
template<typename ColumnType>
ColumnType | get_value (const TreeModelColumn< ColumnType > & column) const
| Gets the value of this column of this row.
template<typename ColumnType>
void | get_value (int column, ColumnType & data) const
| Use get_value(const TreeModelColumn<>& column) unless you do not know the column type at compile-time.
const TreeNodeConstChildren & | children () const
| This returns an STL-like container API, for iterating over the rows.
TreeIter< TreeConstRow > | parent () const
| Gets a const_iterator to the parent row of this row.
TreeIter< TreeConstRow > | get_iter () const
| Gets a const_iterator to this row.
| operator bool () const
| Discover whether this is a valid row.
Public Member Functions inherited from Gtk::TreeIterBase
| TreeIterBase (const TreeIterBase & other) noexcept
TreeIterBase & | operator= (const TreeIterBase & other) noexcept
| TreeIterBase (TreeIterBase && other) noexcept
TreeIterBase & | operator= (TreeIterBase && other) noexcept
| TreeIterBase ()
| TreeIterBase (const GtkTreeIter * gobject)
GtkTreeIter * | gobj ()
| Provides access to the underlying C instance.
const GtkTreeIter * | gobj () const
| Provides access to the underlying C instance.

## Additional Inherited Members
Static Public Member Functions inherited from Gtk::TreeIterBase
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.
Protected Attributes inherited from Gtk::TreeIterBase
GtkTreeIter | gobject_

## Detailed Description

Typedefed as TreeModel::ConstRow.

TreeConstRow is a const version of TreeRow. TreeConstRow does not contain methods for modifying the underlying TreeModel.

See also
  TreeRow

Deprecated
  4.10: Use Gio::ListModel instead.

## Member Function Documentation

## ◆ children()

const TreeNodeConstChildren & Gtk::TreeConstRow::children | ( |  | ) | const

This returns an STL-like container API, for iterating over the rows.

See also Gtk::TreeModel::children() for the top-level children.

## ◆ get_iter()

TreeIter< TreeConstRow > Gtk::TreeConstRow::get_iter | ( |  | ) | const

Gets a const_iterator to this row.

Returns
  A const_iterator to this row.

## ◆ get_value() [1/2]

template <typename ColumnType>

ColumnType Gtk::TreeConstRow::get_value | ( | const TreeModelColumn< ColumnType > & | column | ) | const

Gets the value of this column of this row.

See also operator[]().

Parameters

  column | The model column.

Returns
  The value of this column of this row.

## ◆ get_value() [2/2]

template <typename ColumnType>

void Gtk::TreeConstRow::get_value | ( | int | column,
|  | ColumnType & | data ) const

Use get_value(const TreeModelColumn<>& column) unless you do not know the column type at compile-time.

If the data output argument is of an inappropriate C++ type then this might fail at runtime.

Parameters

  | column | The number of the column whose value you want to query.
  [out] | data | An output argument which will contain the value of this column of this row.

## ◆ operator bool()

Gtk::TreeConstRow::operator bool | ( |  | ) | const
| explicit

Discover whether this is a valid row.

For instance,

if (treerow)
do_something();

Since gtkmm 3.22

## ◆ operator[]()

template <typename ColumnType>

const TreeValueProxy< TreeConstRow, ColumnType > Gtk::TreeConstRow::operator[] | ( | const TreeModelColumn< ColumnType > & | column | ) | const
| inline

Use this to get the value of this column of this row.

This is a templated method, so the compiler will not allow you to provide an inappropriate type of data for the model column.

This is just a more convenient syntax that does the same thing as get_value().

Parameters

  column | The model column.

## ◆ parent()

TreeIter< TreeConstRow > Gtk::TreeConstRow::parent | ( |  | ) | const

Gets a const_iterator to the parent row of this row.

Returns
  A const_iterator to the parent row.