Implements storeGeometry() and restoreGeometry() for ContainerWidget. It
correctly aligns all widgets... wohooo.
This commit is contained in:
@@ -5,20 +5,21 @@
|
||||
ADS_NAMESPACE_BEGIN
|
||||
|
||||
int SectionContent::NextUid = 1;
|
||||
QHash<int, SectionContent*> SectionContent::LookupMap;
|
||||
QHash<int, SectionContent::WeakPtr> SectionContent::LookupMap;
|
||||
QHash<QString, SectionContent::WeakPtr> SectionContent::LookupMapByName;
|
||||
|
||||
SectionContent::SectionContent(QWidget* title, QWidget* content, const QString& uniqueName) :
|
||||
_uid(NextUid++),
|
||||
_uniqueName(uniqueName)
|
||||
_uniqueName(uniqueName),
|
||||
_title(title),
|
||||
_content(content)
|
||||
{
|
||||
_title = title;
|
||||
_content = content;
|
||||
LookupMap.insert(_uid, this);
|
||||
}
|
||||
|
||||
SectionContent::~SectionContent()
|
||||
{
|
||||
LookupMap.remove(_uid);
|
||||
LookupMapByName.remove(_uniqueName);
|
||||
delete _title;
|
||||
delete _content;
|
||||
}
|
||||
@@ -43,14 +44,13 @@ QWidget* SectionContent::contentWidget() const
|
||||
return _content;
|
||||
}
|
||||
|
||||
SectionContent::RefPtr SectionContent::newSectionContent(QWidget* title, QWidget* content)
|
||||
SectionContent::RefPtr SectionContent::newSectionContent(QWidget* title, QWidget* content, const QString& uniqueName)
|
||||
{
|
||||
return QSharedPointer<SectionContent>(new SectionContent(title, content));
|
||||
}
|
||||
|
||||
SectionContent::RefPtr SectionContent::newSectionContent(const QString& title, QWidget* content)
|
||||
{
|
||||
return QSharedPointer<SectionContent>(new SectionContent(new QLabel(title), content));
|
||||
QSharedPointer<SectionContent> sc(new SectionContent(title, content, uniqueName));
|
||||
LookupMap.insert(sc->uid(), sc);
|
||||
if (!sc->uniqueName().isEmpty())
|
||||
LookupMapByName.insert(sc->uniqueName(), sc);
|
||||
return sc;
|
||||
}
|
||||
|
||||
ADS_NAMESPACE_END
|
||||
Reference in New Issue
Block a user