refs #601, #600 CValuePage::getPageFor finds direct children only.

Fixes assert "can't have two CCached in the same object referring to the same value".
This commit is contained in:
Klaus Basan
2016-02-25 22:21:46 +00:00
committed by Mathew Sutcliffe
parent fa27b32984
commit a6840f12a1

View File

@@ -381,7 +381,7 @@ namespace BlackMisc
CValuePage &CValuePage::getPageFor(QObject *parent, CValueCache *cache)
{
auto pages = parent->findChildren<CValuePage *>();
auto pages = parent->findChildren<CValuePage *>("", Qt::FindDirectChildrenOnly);
auto it = std::find_if(pages.cbegin(), pages.cend(), [cache](CValuePage * page) { return page->m_cache == cache; });
if (it == pages.cend()) { return *new CValuePage(parent, cache); }
else { return **it; }