Uses static lazy loaded QHash objects instead of static linker initialized

class members. This should fix multi initialization when linking static
into DLL and EXE at the same time. Hopefully..
This commit is contained in:
mfreiholz
2016-02-23 20:51:19 +01:00
parent 8508a0323a
commit 0238828afa
5 changed files with 73 additions and 33 deletions
@@ -50,9 +50,12 @@ private:
QPointer<QWidget> _title;
QPointer<QWidget> _content;
static int NextUid;
static QHash<int, SectionContent::WeakPtr> LookupMap;
static QHash<QString, SectionContent::WeakPtr> LookupMapByName;
static int GetNextUid();
static QHash<int, SectionContent::WeakPtr>& GetLookupMap();
static QHash<QString, SectionContent::WeakPtr>& GetLookupMapByName();
//static QHash<int, SectionContent::WeakPtr> LookupMap;
//static QHash<QString, SectionContent::WeakPtr> LookupMapByName;
};
ADS_NAMESPACE_END
@@ -68,9 +68,13 @@ private:
SectionContent::RefPtr _mousePressContent;
SectionTitleWidget* _mousePressTitleWidget;
static int NextUid;
static QHash<int, SectionWidget*> LookupMap;
static QHash<ContainerWidget*, QHash<int, SectionWidget*> > LookupMapByContainer;
static int GetNextUid();
static QHash<int, SectionWidget*>& GetLookupMap();
static QHash<ContainerWidget*, QHash<int, SectionWidget*> >& GetLookupMapByContainer();
// static int NextUid;
// static QHash<int, SectionWidget*> LookupMap;
// static QHash<ContainerWidget*, QHash<int, SectionWidget*> > LookupMapByContainer;
};
ADS_NAMESPACE_END