2015-12-09 19:21:38 +08:00
|
|
|
#ifndef FLOATINGWIDGET_H
|
|
|
|
#define FLOATINGWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QFrame>
|
|
|
|
|
2016-02-02 22:01:48 +08:00
|
|
|
#include "ads/API.h"
|
|
|
|
#include "ads/SectionContent.h"
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
class QBoxLayout;
|
|
|
|
|
|
|
|
ADS_NAMESPACE_BEGIN
|
|
|
|
|
2016-02-02 20:49:10 +08:00
|
|
|
class ContainerWidget;
|
2015-12-09 19:21:38 +08:00
|
|
|
class SectionTitleWidget;
|
|
|
|
class SectionContentWidget;
|
|
|
|
|
|
|
|
// FloatingWidget holds and displays SectionContent as a floating window.
|
|
|
|
// It can be resized, moved and dropped back into a SectionWidget.
|
|
|
|
class FloatingWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-02-02 20:49:10 +08:00
|
|
|
FloatingWidget(ContainerWidget* container, SectionContent::RefPtr sc, SectionTitleWidget* titleWidget, SectionContentWidget* contentWidget, QWidget* parent = nullptr);
|
|
|
|
virtual ~FloatingWidget();
|
|
|
|
|
2015-12-09 19:21:38 +08:00
|
|
|
InternalContentData takeContent();
|
2016-02-02 20:49:10 +08:00
|
|
|
SectionContent::RefPtr content() const { return _content; }
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent* e);
|
|
|
|
|
|
|
|
private:
|
2016-02-02 20:49:10 +08:00
|
|
|
ContainerWidget* _container;
|
2015-12-09 19:21:38 +08:00
|
|
|
SectionContent::RefPtr _content;
|
|
|
|
SectionTitleWidget* _titleWidget;
|
|
|
|
SectionContentWidget* _contentWidget;
|
|
|
|
|
|
|
|
QBoxLayout* _titleLayout;
|
|
|
|
};
|
|
|
|
|
|
|
|
ADS_NAMESPACE_END
|
|
|
|
#endif
|