Remove isXrefCell method...

and use instead columnTypeForIndex method
This commit is contained in:
joshua
2021-12-02 18:54:45 +01:00
parent ce8bd7fae3
commit 6e68e6047a
3 changed files with 29 additions and 36 deletions

View File

@@ -327,31 +327,6 @@ QVector<QPair<RealTerminalData, RealTerminalData>> TerminalStripModel::modifiedR
return returned_vector;
}
/**
* @brief TerminalStripModel::isXrefCell
* @param index
* @param elmt : Pointer of a pointer element
* @return true if the index is the Xref cell, if true the pointer \p element
* will be set to the element associated to the cell.
*/
bool TerminalStripModel::isXrefCell(const QModelIndex &index, Element **element)
{
if (index.model() == this
&& index.isValid()
&& index.column() == XREF_CELL)
{
if (index.row() < rowCount())
{
if (auto data = dataAtRow(index.row()) ; data.element_) {
*element = data.element_.data();
}
}
return true;
}
return false;
}
/**
* @brief TerminalStripModel::levelCellCount
* Check for each index of @a index_list if the cell represented by the index
@@ -448,6 +423,20 @@ QVector<RealTerminalData> TerminalStripModel::realTerminalDataForIndex(QModelInd
return vector_;
}
/**
* @brief TerminalStripModel::realTerminalDataForIndex
* @param index
* @return RealTerminalData at index @a index or null RealTerminalData if invalid
*/
RealTerminalData TerminalStripModel::realTerminalDataForIndex(const QModelIndex &index) const
{
if (index.isValid()) {
return realDataAtIndex(index.row());
} else {
return RealTerminalData();
}
}
void TerminalStripModel::fillPhysicalTerminalData()
{
//Get all physical terminal