connecting basket model and sale model
This commit is contained in:
parent
f697487d6b
commit
3ec2143f28
5 changed files with 23 additions and 2 deletions
|
@ -155,4 +155,14 @@ QVariant SaleModel::headerData(int section, Qt::Orientation orientation, int rol
|
|||
return QStringLiteral("%1").arg(section);
|
||||
} else
|
||||
return "";
|
||||
}
|
||||
|
||||
void SaleModel::onBasketDataChanged()
|
||||
{
|
||||
emit beginResetModel();
|
||||
auto& sales = marketplace_->getSales();
|
||||
std::sort(sales.begin(), sales.end(), [](const auto& lhs, const auto& rhs) {
|
||||
return lhs->getTimestamp() > rhs->getTimestamp();
|
||||
});
|
||||
emit endResetModel();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue