60 Qt::Alignment alignment{Qt::AlignLeft};
93 QList<QSharedPointer<Item>> _list;
142 QModelIndex
index(
int row,
int column = 0)
const;
164 void update(
const QModelIndex& index,
const QList<int>& roles = {});
172 void update(
int row,
int column = -1,
const QList<int>& roles = {});
190 Q_SIGNAL
void getRowData(
const QModelIndex& index,
int role, QVariant& data);
195 Q_SIGNAL
void setRowData(
const QModelIndex& index,
int role,
const QVariant& data);
Holds column entry information.
Definition ListModel.h:32
Qt::ItemFlags flags
Additional flags for the column. Only 'ItemIsEditable', 'ItemIsUserCheckable' and 'ItemIsUserTristate...
Definition ListModel.h:56
int64_t index
Definition ListModel.h:49
Holds all columns information.
Definition ListModel.h:26
const Item * getItem(int index) const
Gets an item in the column list.
Item * add()
Adds a column.
void clear()
Clears all columns.
Columns(Private *prv)
Constructor passing the list model only for the list model to access.
int count() const
Gets the amount of columns.
Definition ListModel.h:13
void insertRows(int row, int count)
void setTreeView(QTreeView *treeview)
Attaches the given tree view but detaching the old one first.
Columns & getColumns()
Gets the instance holding the column information.
const Columns & getColumns() const
Gets the constant instance holding the column information.
void removeRow(const QModelIndex &index)
Removes a row indicated by the index from the model.
void setCurrentIndex(int row, int column=0)
Sets the current focussed list entry by the given row and optional column.
QModelIndex currentIndex() const
Gets the current focussed list entry.
Q_SIGNAL void currentRowChanged(int current, int previous)
Signal emitted when the selected row changed.
Q_SIGNAL void contextMenuRequested(const QModelIndex &index, const QPoint &point)
Signal emitted when a context menu is requested.
void update(int row, int column=-1, const QList< int > &roles={})
Update values in the given column and row.
Q_SIGNAL void getRowData(const QModelIndex &index, int role, QVariant &data)
Signal emitted to retrieve data to populate the rows.
QTreeView * getTreeView()
Gets the current attached treeview.
void removeRows(int row, int count=1)
void setRowCount(int count)
Sets the row count.
ListModel(QObject *parent)
QObject type of constructor. When the parent is a QTreeView or derived type the setTreeView is called...
void scrollTo(const QModelIndex &index)
void moveRow(int from, int to)
~ListModel() override
Virtual destructor.
void setCurrentIndex(const QModelIndex &index)
Sets the current focussed list entryby the given index.
void update(const QModelIndex &index, const QList< int > &roles={})
Update value in the field pointed at by the given index.
QModelIndex index(int row, int column=0) const
Creates an index from the given row and column.
Q_SIGNAL void setRowData(const QModelIndex &index, int role, const QVariant &data)
Signal emitted to set on the data source.
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10