Qt-Advanced-Docking-System/AdvancedDockingSystem/include/ads/SectionContent.h

46 lines
1.0 KiB
C
Raw Normal View History

2015-12-09 19:21:38 +08:00
#ifndef SECTIONCONTENT_H
#define SECTIONCONTENT_H
#include <QPointer>
#include <QWidget>
#include <QHash>
#include <QSharedPointer>
#include <QWeakPointer>
2015-12-09 19:21:38 +08:00
#include "ads/API.h"
2015-12-09 19:21:38 +08:00
ADS_NAMESPACE_BEGIN
class SectionContent
{
friend class ContainerWidget;
private:
SectionContent(QWidget* title, QWidget* content, const QString& uniqueName = QString()); ///< Do not use!
2015-12-09 19:21:38 +08:00
public:
typedef QSharedPointer<SectionContent> RefPtr;
typedef QWeakPointer<SectionContent> WeakPtr;
2015-12-09 19:21:38 +08:00
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());
2015-12-09 19:21:38 +08:00
private:
2015-12-09 19:21:38 +08:00
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;
2015-12-09 19:21:38 +08:00
};
ADS_NAMESPACE_END
2016-02-12 14:15:10 +08:00
#endif