![]() |
Scanframe Modular Application 0.1.0
|
#include <ListModel.h>
Classes | |
class | Columns |
Holds all columns information. More... | |
Public Member Functions | |
ListModel (QObject *parent) | |
QObject type of constructor. When the parent is a QTreeView or derived type the setTreeView is called upon it. | |
~ListModel () override | |
Virtual destructor. | |
void | setTreeView (QTreeView *treeview) |
Attaches the given tree view but detaching the old one first. | |
QTreeView * | getTreeView () |
Gets the current attached treeview. | |
Columns & | getColumns () |
Gets the instance holding the column information. | |
const Columns & | getColumns () const |
Gets the constant instance holding the column information. | |
QModelIndex | currentIndex () const |
Gets the current focussed list entry. | |
QModelIndex | index (int row, int column=0) const |
Creates an index from the given row and column. | |
void | setCurrentIndex (const QModelIndex &index) |
Sets the current focussed list entryby the given index. | |
void | setCurrentIndex (int row, int column=0) |
Sets the current focussed list entry by the given row and optional column. | |
void | setRowCount (int count) |
Sets the row count. | |
void | update (const QModelIndex &index, const QList< int > &roles={}) |
Update value in the field pointed at by the given index. | |
void | update (int row, int column=-1, const QList< int > &roles={}) |
Update values in the given column and row. | |
void | removeRow (const QModelIndex &index) |
Removes a row indicated by the index from the model. | |
void | scrollTo (const QModelIndex &index) |
void | removeRows (int row, int count=1) |
void | insertRows (int row, int count) |
void | refresh () const |
void | moveRow (int from, int to) |
Q_SIGNAL void | getRowData (const QModelIndex &index, int role, QVariant &data) |
Signal emitted to retrieve data to populate the rows. | |
Q_SIGNAL void | setRowData (const QModelIndex &index, int role, const QVariant &data) |
Signal emitted to set on the data source. | |
Q_SIGNAL void | contextMenuRequested (const QModelIndex &index, const QPoint &point) |
Signal emitted when a context menu is requested. | |
Q_SIGNAL void | currentRowChanged (int current, int previous) |
Signal emitted when the selected row changed. | |
|
explicit |
QObject type of constructor. When the parent is a QTreeView or derived type the setTreeView is called upon it.
|
override |
Virtual destructor.
Q_SIGNAL void sf::ListModel::contextMenuRequested | ( | const QModelIndex & | index, |
const QPoint & | point | ||
) |
Signal emitted when a context menu is requested.
QModelIndex sf::ListModel::currentIndex | ( | ) | const |
Gets the current focussed list entry.
Q_SIGNAL void sf::ListModel::currentRowChanged | ( | int | current, |
int | previous | ||
) |
Signal emitted when the selected row changed.
Columns & sf::ListModel::getColumns | ( | ) |
Gets the instance holding the column information.
const Columns & sf::ListModel::getColumns | ( | ) | const |
Gets the constant instance holding the column information.
Q_SIGNAL void sf::ListModel::getRowData | ( | const QModelIndex & | index, |
int | role, | ||
QVariant & | data | ||
) |
Signal emitted to retrieve data to populate the rows.
QTreeView * sf::ListModel::getTreeView | ( | ) |
Gets the current attached treeview.
QModelIndex sf::ListModel::index | ( | int | row, |
int | column = 0 |
||
) | const |
Creates an index from the given row and column.
void sf::ListModel::insertRows | ( | int | row, |
int | count | ||
) |
void sf::ListModel::moveRow | ( | int | from, |
int | to | ||
) |
void sf::ListModel::refresh | ( | ) | const |
void sf::ListModel::removeRow | ( | const QModelIndex & | index | ) |
Removes a row indicated by the index from the model.
index | Row to be removed. |
void sf::ListModel::removeRows | ( | int | row, |
int | count = 1 |
||
) |
void sf::ListModel::scrollTo | ( | const QModelIndex & | index | ) |
void sf::ListModel::setCurrentIndex | ( | const QModelIndex & | index | ) |
Sets the current focussed list entryby the given index.
void sf::ListModel::setCurrentIndex | ( | int | row, |
int | column = 0 |
||
) |
Sets the current focussed list entry by the given row and optional column.
void sf::ListModel::setRowCount | ( | int | count | ) |
Sets the row count.
Q_SIGNAL void sf::ListModel::setRowData | ( | const QModelIndex & | index, |
int | role, | ||
const QVariant & | data | ||
) |
Signal emitted to set on the data source.
void sf::ListModel::setTreeView | ( | QTreeView * | treeview | ) |
Attaches the given tree view but detaching the old one first.
treeview |
void sf::ListModel::update | ( | const QModelIndex & | index, |
const QList< int > & | roles = {} |
||
) |
Update value in the field pointed at by the given index.
index | Index value of the list. |
roles | Roles to update. Default is all. |
void sf::ListModel::update | ( | int | row, |
int | column = -1 , |
||
const QList< int > & | roles = {} |
||
) |
Update values in the given column and row.
row | When -1 all rows are selected. |
column | When -1 all columns are selected. |
roles | Roles to update. Default is all. |