From f58df0419643f86df44555ece3280e3421ab6da0 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Fri, 22 Sep 2023 02:53:25 +0300 Subject: [PATCH] QConcatenateTablesProxyModel: simplify code If there is a reason to static_cast to `const QAIM*` then cast away the const, I failed to see it. QObject::sender() returns a non-co. Change-Id: Ibf8c8613c3de1584b426269c1ffba94db75d26d6 Reviewed-by: David Faure --- src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp index e6d12cd755..7047a1c1fc 100644 --- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp +++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp @@ -641,7 +641,7 @@ void QConcatenateTablesProxyModelPrivate::_q_slotSourceLayoutChanged(const QList void QConcatenateTablesProxyModelPrivate::_q_slotModelAboutToBeReset() { Q_Q(QConcatenateTablesProxyModel); - Q_ASSERT(m_models.contains(const_cast(static_cast(q->sender())))); + Q_ASSERT(m_models.contains(static_cast(q->sender()))); q->beginResetModel(); // A reset might reduce both rowCount and columnCount, and we can't notify of both at the same time, // and notifying of one after the other leaves an intermediary invalid situation. @@ -651,7 +651,7 @@ void QConcatenateTablesProxyModelPrivate::_q_slotModelAboutToBeReset() void QConcatenateTablesProxyModelPrivate::_q_slotModelReset() { Q_Q(QConcatenateTablesProxyModel); - Q_ASSERT(m_models.contains(const_cast(static_cast(q->sender())))); + Q_ASSERT(m_models.contains(static_cast(q->sender()))); m_columnCount = calculatedColumnCount(); m_rowCount = computeRowsPrior(nullptr); q->endResetModel();