refs #576, tweaking view base

* renaming in view base (similar to Qt name rowCount)
* insert function for whole container
This commit is contained in:
Klaus Basan
2016-01-23 02:17:38 +01:00
parent 85881ffaf6
commit de4b07dc32
4 changed files with 80 additions and 55 deletions

View File

@@ -434,6 +434,23 @@ namespace BlackGui
this->emitRowCountChanged();
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::insert(const ContainerType &container)
{
if (container.isEmpty()) { return; }
beginInsertRows(QModelIndex(), 0, 0);
this->m_container.insert(container);
endInsertRows();
if (this->hasFilter())
{
this->beginResetModel();
this->updateFilteredContainer();
this->endResetModel();
}
this->emitRowCountChanged();
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::remove(const ObjectType &object)
{