|
The IsotopicDataTableViewModel class provides a table view widget to display isotopic data. More...
Header: | #include <IsotopicDataTableViewModel.hpp> |
Inherits: | QAbstractTableModel |
IsotopicDataTableViewModel(QObject *parent_p, libXpertMass::IsotopicDataSPtr isotopic_data_sp) | |
virtual | ~IsotopicDataTableViewModel() |
bool | clearAllData() |
void | editCompleted(const QString &text) |
void | insertIsotopeRowAbove() |
void | insertIsotopeRowBelow() |
bool | insertRow(int row, const QModelIndex &parent = QModelIndex()) |
virtual const QWidget * | parent() const |
void | removeSelected() |
void | setTableView(IsotopicDataTableView *table_view_p) |
IsotopicDataTableView * | tableView() |
virtual int | columnCount(const QModelIndex &parent = QModelIndex()) const override |
virtual QVariant | data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const override |
virtual Qt::ItemFlags | flags(const QModelIndex &index) const override |
virtual QVariant | headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override |
virtual int | rowCount(const QModelIndex &parent = QModelIndex()) const override |
virtual bool | setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override |
QWidget * | mp_parent |
IsotopicDataTableView * | mp_tableView |
libXpertMass::IsotopicDataSPtr | msp_isotopicData |
Constructs a IsotopicDataTableViewModel instance.
[virtual noexcept]
IsotopicDataTableViewModel::~IsotopicDataTableViewModel()Destructs this IsotopicDataTableViewModel instance.
Removes all the rows from the table view.
Returns true if rows were effectively removed, false otherwise.
[override virtual]
int IsotopicDataTableViewModel::columnCount(const QModelIndex &parent = QModelIndex()) constReimplements: QAbstractItemModel::columnCount(const QModelIndex &parent) const.
Returns the count of columns in this table view.
parent is unused.
[override virtual]
QVariant IsotopicDataTableViewModel::data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) constReimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.
Returns the data for cell at index, for role.
If role is Qt::TextAlignmentRole, returns (Qt::AlignRight | Qt::AlignVCenter).
If role is Qt::DisplayRole, returns the text in the cell described in index in the form of a QVariant.
See also setData().
Signals that the editing of a cell is completed with final text.
[override virtual]
Qt::ItemFlags IsotopicDataTableViewModel::flags(const QModelIndex &index) constReimplements: QAbstractTableModel::flags(const QModelIndex &index) const.
Returns the flags for the index.
The returned flags include Qt::ItemIsEditable.
[override virtual]
QVariant IsotopicDataTableViewModel::headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) constReimplements: QAbstractItemModel::headerData(int section, Qt::Orientation orientation, int role) const.
Returns the header data for section.
If orientation is Qt::Vertical returns the row number; if orientation is Qt::Horizontal, returns the text in the header. If role is not Qt::DisplayRole, returns QVariant().
Inserts a new row above the current index.
Inserts a new row below the current index.
Returns true if the row could be inserted at reference model index parent.
The insertion occurs at the index right before row such that the newly inserted row will be effectively at row index.
The cells of the inserted row will be set with default values.
[virtual]
const QWidget *IsotopicDataTableViewModel::parent() constReturns the parent widget.
Removes all the selected rows.
[override virtual]
int IsotopicDataTableViewModel::rowCount(const QModelIndex &parent = QModelIndex()) constReimplements: QAbstractItemModel::rowCount(const QModelIndex &parent) const.
Returns the count of rows in this table view.
parent is unused.
[override virtual]
bool IsotopicDataTableViewModel::setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole)Reimplements: QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role).
Set the data to value for the cell described by index.
If role is not Qt::EditRole, returns false. Returns true if value could be converted to the right type depending on the column of the cell, true otherwise.
The data in the cell described by index is read, converted to the right type and set to the matching isotope instance. The row datum in index points to the index of the isotope in the isotopica data.
If conversion from QVariant to the proper data type fails, returns false, otherwise returns true.
See also data().
Sets the table view widget table_view_p.
See also tableView().
Returns the table view widget.
See also setTableView().
This variable holds the parent widget.
This variable holds the table view widget.
This variable holds the isotopic data.