forked from qt-creator/qt-creator
Marketplace: Do not use dynamic_cast
Amends c3946529ca.
Change-Id: If66ce3169dd1c61334a26f5532866dda9b0338a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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 §ion, 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user