summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels/qidentityproxymodel_p.h
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-09-06 20:51:15 +0300
committerAhmad Samir <a.samirh78@gmail.com>2023-12-15 16:52:10 +0300
commit675b4f63feab7c81c75e49f6dea82a39dd18f489 (patch)
tree94d92034e8b89a1051322495d6320d38b5cd00d1 /src/corelib/itemmodels/qidentityproxymodel_p.h
parent1648d2d93a9b4c9a787be01b070aa2ca1eb31099 (diff)
QIdentityProxyModel: add setHandleSourceLayoutChanges(bool)
Some sub-classes have special handling of source model layout changes (abbreviated as SMLC from here on out), they relied on disconnecting the connections to the _q_*layout* slots in the private class using the SLOT macro. This isn't possible any more after recent changes (and the method were renamed to remove _q_ prefix). Sub-classes resorting to using private API is a clear sign some functionality is missing from the public API, so a cleaner solution for this issue is adding this setter which enables sub-classes to tell QIdentityProxyModel to leave handling of the SMLC to them. Thanks to David Faure for the idea/solution. [ChangeLog][QtCore][QIdentityProxyModel] Added setHandleSourceLayoutChanges(bool) method to allow sub-classes to indicate to QIdentityProxyModel that they will handle source model layout changes on their own. Also added a getter, isHandleSourceLayoutChanges(). Change-Id: I1de79dd693ce32a6e2df9a7c81dd4abdc5f00248 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/corelib/itemmodels/qidentityproxymodel_p.h')
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qidentityproxymodel_p.h b/src/corelib/itemmodels/qidentityproxymodel_p.h
index d36fa426da..78e1f5316c 100644
--- a/src/corelib/itemmodels/qidentityproxymodel_p.h
+++ b/src/corelib/itemmodels/qidentityproxymodel_p.h
@@ -63,6 +63,7 @@ public:
void sourceModelReset();
private:
+ bool m_handleLayoutChanges = true;
QVarLengthArray<QMetaObject::Connection, 18> m_sourceModelConnections;
};