Chatterino
Public Member Functions | List of all members
chatterino::GenericListModel Class Reference

#include <GenericListModel.hpp>

Inheritance diagram for chatterino::GenericListModel:
[legend]
Collaboration diagram for chatterino::GenericListModel:
[legend]

Public Member Functions

 GenericListModel (QWidget *parent=nullptr)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 Reimplements QAbstractItemModel::rowCount. More...
 
QVariant data (const QModelIndex &index, int role) const
 Reimplements QAbstractItemModel::data. Currently, the role parameter is not used and an GenericListItem * is always returned. More...
 
void addItem (std::unique_ptr< GenericListItem > item)
 Add an item to this QuickSwitcherModel. It will be displayed in attached views. More...
 
void clear ()
 Clears this QuickSwitcherModel of all items. This will delete all GenericListItems added after the last invokation of QuickSwitcherModel::clear (and invalidate their pointers). More...
 

Constructor & Destructor Documentation

◆ GenericListModel()

chatterino::GenericListModel::GenericListModel ( QWidget *  parent = nullptr)

Member Function Documentation

◆ addItem()

void chatterino::GenericListModel::addItem ( std::unique_ptr< GenericListItem item)

Add an item to this QuickSwitcherModel. It will be displayed in attached views.

NOTE: The model will take ownership of the pointer. In particular, the same item should not be passed to multiple QuickSwitcherModels.

Parameters
itemitem to add to the model
Here is the caller graph for this function:

◆ clear()

void chatterino::GenericListModel::clear ( )

Clears this QuickSwitcherModel of all items. This will delete all GenericListItems added after the last invokation of QuickSwitcherModel::clear (and invalidate their pointers).

Here is the caller graph for this function:

◆ data()

QVariant chatterino::GenericListModel::data ( const QModelIndex &  index,
int  role 
) const

Reimplements QAbstractItemModel::data. Currently, the role parameter is not used and an GenericListItem * is always returned.

Parameters
indexindex of item to fetch data from
role(not used)
Returns
GenericListItem * (wrapped as QVariant) at index

◆ rowCount()

int chatterino::GenericListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

Reimplements QAbstractItemModel::rowCount.

Returns
number of items currrently present in this model
Here is the caller graph for this function:

The documentation for this class was generated from the following files: