#include <GenericListModel.hpp>
|
| | 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...
|
| |
◆ GenericListModel()
| chatterino::GenericListModel::GenericListModel |
( |
QWidget * |
parent = nullptr | ) |
|
◆ 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
-
| item | item to add to the model |
◆ 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).
◆ 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
-
| index | index 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
The documentation for this class was generated from the following files: