mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
44 lines
1.0 KiB
C++
44 lines
1.0 KiB
C++
#ifndef FLOATINGWIDGET_H
|
|
#define FLOATINGWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QFrame>
|
|
|
|
#include "ads/API.h"
|
|
#include "ads/SectionContent.h"
|
|
|
|
class QBoxLayout;
|
|
|
|
ADS_NAMESPACE_BEGIN
|
|
|
|
class ContainerWidget;
|
|
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:
|
|
FloatingWidget(ContainerWidget* container, SectionContent::RefPtr sc, SectionTitleWidget* titleWidget, SectionContentWidget* contentWidget, QWidget* parent = nullptr);
|
|
virtual ~FloatingWidget();
|
|
|
|
InternalContentData takeContent();
|
|
SectionContent::RefPtr content() const { return _content; }
|
|
|
|
protected:
|
|
virtual void closeEvent(QCloseEvent* e);
|
|
|
|
private:
|
|
ContainerWidget* _container;
|
|
SectionContent::RefPtr _content;
|
|
SectionTitleWidget* _titleWidget;
|
|
SectionContentWidget* _contentWidget;
|
|
|
|
QBoxLayout* _titleLayout;
|
|
};
|
|
|
|
ADS_NAMESPACE_END
|
|
#endif |