StatusQ(ObjectProxyModel): const_cast removed from proxyObject method
Closes: #15744
This commit is contained in:
parent
6b04e52cf0
commit
44d04bb514
|
@ -40,8 +40,7 @@ public:
|
|||
void setExposedRoles(const QStringList& exposedRoles);
|
||||
const QStringList& exposedRoles() const;
|
||||
|
||||
Q_INVOKABLE QObject* proxyObject(int index);
|
||||
const QObject* proxyObject(int index) const;
|
||||
Q_INVOKABLE QObject* proxyObject(int index) const;
|
||||
|
||||
signals:
|
||||
void delegateChanged();
|
||||
|
|
|
@ -162,7 +162,7 @@ const QStringList& ObjectProxyModel::exposedRoles() const
|
|||
return m_exposedRoles;
|
||||
}
|
||||
|
||||
QObject* ObjectProxyModel::proxyObject(int index)
|
||||
QObject* ObjectProxyModel::proxyObject(int index) const
|
||||
{
|
||||
if (index >= m_container.size())
|
||||
return nullptr;
|
||||
|
@ -177,7 +177,6 @@ QObject* ObjectProxyModel::proxyObject(int index)
|
|||
? creationContext : m_delegate->engine()->rootContext();
|
||||
|
||||
auto context = new QQmlContext(parentContext);
|
||||
|
||||
auto rowData = new QQmlPropertyMap(context);
|
||||
auto model = sourceModel();
|
||||
|
||||
|
@ -207,11 +206,6 @@ QObject* ObjectProxyModel::proxyObject(int index)
|
|||
return instance;
|
||||
}
|
||||
|
||||
const QObject* ObjectProxyModel::proxyObject(int index) const
|
||||
{
|
||||
return const_cast<ObjectProxyModel*>(this)->proxyObject(index);
|
||||
}
|
||||
|
||||
void ObjectProxyModel::resetInternalData()
|
||||
{
|
||||
QIdentityProxyModel::resetInternalData();
|
||||
|
|
Loading…
Reference in New Issue