Optimizes includes and forward declarations.

Fixes a bug where SectionWidget removes itself from _sections list during a qDeleteAll call on _sections.. that was stupid..
This commit is contained in:
mfreiholz
2016-02-26 12:43:14 +01:00
parent 74f6ba333f
commit 06304b9818
15 changed files with 125 additions and 80 deletions

View File

@@ -73,16 +73,17 @@ SectionWidget::SectionWidget(ContainerWidget* parent) :
setGraphicsEffect(shadow);
#endif
GetLookupMap().insert(_uid, this);
GetLookupMapByContainer()[_container].insert(_uid, this);
SWLookupMapById(_container).insert(_uid, this);
}
SectionWidget::~SectionWidget()
{
qDebug() << Q_FUNC_INFO;
GetLookupMap().remove(_uid);
GetLookupMapByContainer()[_container].remove(_uid);
_container->_sections.removeAll(this); // Note: I don't like this here, but we have to remove it from list...
if (_container)
{
SWLookupMapById(_container).remove(_uid);
_container->_sections.removeAll(this); // Note: I don't like this here, but we have to remove it from list...
}
// Delete empty QSplitter.
QSplitter* splitter = findParentSplitter(this);
@@ -324,17 +325,17 @@ int SectionWidget::GetNextUid()
return ++NextUid;
}
QHash<int, SectionWidget*>& SectionWidget::GetLookupMap()
{
static QHash<int, SectionWidget*> LookupMap;
return LookupMap;
//QHash<int, SectionWidget*>& SectionWidget::GetLookupMap()
//{
// static QHash<int, SectionWidget*> LookupMap;
// return LookupMap;
}
//}
QHash<ContainerWidget*, QHash<int, SectionWidget*> >& SectionWidget::GetLookupMapByContainer()
{
static QHash<ContainerWidget*, QHash<int, SectionWidget*> > LookupMapByContainer;
return LookupMapByContainer;
}
//QHash<ContainerWidget*, QHash<int, SectionWidget*> >& SectionWidget::GetLookupMapByContainer()
//{
// static QHash<ContainerWidget*, QHash<int, SectionWidget*> > LookupMapByContainer;
// return LookupMapByContainer;
//}
ADS_NAMESPACE_END