Marketplace: Do not use dynamic_cast

Amends c3946529ca.

Change-Id: If66ce3169dd1c61334a26f5532866dda9b0338a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2020-05-15 13:43:26 +02:00
parent c2c5731d50
commit eac5bc2a06

View File

@@ -79,8 +79,9 @@ public:
{
if (columnCount < 1)
columnCount = 1;
if (auto gridProxyModel = dynamic_cast<Core::GridProxyModel *>(model()))
gridProxyModel->setColumnCount(columnCount);
auto gridProxyModel = static_cast<Core::GridProxyModel *>(model());
gridProxyModel->setColumnCount(columnCount);
}
};
@@ -423,7 +424,7 @@ void SectionedProducts::addNewSection(const Section &section, const QList<Core::
gridView->setFixedSize(gridView->viewportSizeHint());
// add the items also to the all products model to be able to search correctly
auto allProducts = dynamic_cast<ProductListModel *>(m_filteredAllProductsModel->sourceModel());
auto allProducts = static_cast<ProductListModel *>(m_filteredAllProductsModel->sourceModel());
allProducts->appendItems(items);
m_allProductsView->setColumnCount(m_columnCount);
}