mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #576, tweaking view base
* renaming in view base (similar to Qt name rowCount) * insert function for whole container
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user