ark::plotting::ObjectSearchTableModel

Defined in header “ark/plotting/gui/object_search_table_model.hh”.


A table model that allows you to quickly search and select objects. The list of objects must be poplated from an external source.

Typedefs

  • using Columns =
    A list of columns, in display-order.

Methods

  • ObjectSearchTableModel(QObject * parent)
    Constructor.

  • ~ObjectSearchTableModel()
    Destructor. Implemented privately to hide details.

  • int rowCount(const QModelIndex & parent)
    Returns a count of rows for this model.

  • int columnCount(const QModelIndex & parent)
    Returns the count of columns for this model.

  • QVariant data(const QModelIndex & index, int role)
    Returns the raw data for the given model index.

  • std::string subscriber_name(int row)
    Returns the channel/field name from the given row, in the display role.

  • Qt::ItemFlags flags(const QModelIndex & index)
    Returns flags for a given column. Used to mark if something is selectable or not.

  • QVariant headerData(int section, Qt::Orientation orientation, int role)
    Returns the header names at the given column.

  • void set_data(const std::vector< SearchableObject > & objects)
    Sets the list of searchable objects that we should display. TODO(dtascione): Can be moved into a top-level library and just pass in the actual field list.

  • void set_row_selected(int row, bool selected)
    Selects or unselects data at the given row (depending on the selected boolean).

  • bool is_row_selected(int row)
    Returns true if the given row is selected, false otherwise.

  • std::optional< int > row_at_subscriber_name(const std::string & subscriber_name)
    Returns the row number for the given subscriber name, if any.