mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
Remove isXrefCell method...
and use instead columnTypeForIndex method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user