Qt-Advanced-Docking-System/AdvancedDockingSystem/include/ads/SectionContent.h
2016-02-12 07:15:10 +01:00

46 lines
1.0 KiB
C++

#ifndef SECTIONCONTENT_H
#define SECTIONCONTENT_H
#include <QPointer>
#include <QWidget>
#include <QHash>
#include <QSharedPointer>
#include <QWeakPointer>
#include "ads/API.h"
ADS_NAMESPACE_BEGIN
class SectionContent
{
friend class ContainerWidget;
private:
SectionContent(QWidget* title, QWidget* content, const QString& uniqueName = QString()); ///< Do not use!
public:
typedef QSharedPointer<SectionContent> RefPtr;
typedef QWeakPointer<SectionContent> WeakPtr;
virtual ~SectionContent();
int uid() const;
QString uniqueName() const;
QWidget* titleWidget() const;
QWidget* contentWidget() const;
static RefPtr newSectionContent(QWidget* title, QWidget* content, const QString& uniqueName = QString());
private:
const int _uid;
const QString _uniqueName;
QPointer<QWidget> _title;
QPointer<QWidget> _content;
static int NextUid;
static QHash<int, SectionContent::WeakPtr> LookupMap;
static QHash<QString, SectionContent::WeakPtr> LookupMapByName;
};
ADS_NAMESPACE_END
#endif