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

47 lines
1.1 KiB
C
Raw Normal View History

2015-12-09 19:21:38 +08:00
#ifndef FLOATINGWIDGET_H
#define FLOATINGWIDGET_H
#include <QWidget>
class QBoxLayout;
2015-12-09 19:21:38 +08:00
#include "ads/API.h"
#include "ads/SectionContent.h"
2015-12-09 19:21:38 +08:00
ADS_NAMESPACE_BEGIN
class ContainerWidget;
2015-12-09 19:21:38 +08:00
class SectionTitleWidget;
class SectionContentWidget;
class InternalContentData;
2015-12-09 19:21:38 +08:00
// 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
friend class ContainerWidget;
2015-12-09 19:21:38 +08:00
public:
2016-02-12 14:15:10 +08:00
FloatingWidget(ContainerWidget* container, SectionContent::RefPtr sc, SectionTitleWidget* titleWidget, SectionContentWidget* contentWidget, QWidget* parent = NULL);
virtual ~FloatingWidget();
SectionContent::RefPtr content() const { return _content; }
2015-12-09 19:21:38 +08:00
public://private:
bool takeContent(InternalContentData& data);
2015-12-09 19:21:38 +08:00
private slots:
void onCloseButtonClicked();
2015-12-09 19:21:38 +08:00
private:
ContainerWidget* _container;
2015-12-09 19:21:38 +08:00
SectionContent::RefPtr _content;
SectionTitleWidget* _titleWidget;
SectionContentWidget* _contentWidget;
QBoxLayout* _titleLayout;
};
ADS_NAMESPACE_END
2016-02-12 14:15:10 +08:00
#endif