2015-12-09 19:21:38 +08:00
|
|
|
#ifndef SECTIONCONTENT_H
|
|
|
|
#define SECTIONCONTENT_H
|
|
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QHash>
|
|
|
|
#include <QSharedPointer>
|
|
|
|
|
2016-02-02 22:01:48 +08:00
|
|
|
#include "ads/API.h"
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
ADS_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class SectionContent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef QSharedPointer<SectionContent> RefPtr;
|
|
|
|
|
|
|
|
SectionContent(QWidget* title, QWidget* content, const QString& uniqueName = QString()); ///< Do not use!
|
|
|
|
virtual ~SectionContent();
|
|
|
|
|
|
|
|
int uid() const;
|
|
|
|
QString uniqueName() const;
|
|
|
|
QWidget* titleWidget() const;
|
|
|
|
QWidget* contentWidget() const;
|
|
|
|
|
|
|
|
static RefPtr newSectionContent(QWidget* title, QWidget* content);
|
|
|
|
static RefPtr newSectionContent(const QString& title, QWidget* content);
|
|
|
|
|
|
|
|
public:
|
|
|
|
const int _uid;
|
|
|
|
const QString _uniqueName;
|
|
|
|
QPointer<QWidget> _title;
|
|
|
|
QPointer<QWidget> _content;
|
|
|
|
|
|
|
|
static int NextUid;
|
|
|
|
static QHash<int, SectionContent*> LookupMap;
|
|
|
|
};
|
|
|
|
|
|
|
|
ADS_NAMESPACE_END
|
|
|
|
#endif
|