API Documentation
Loading...
Searching...
No Matches
FloatingWidget.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: FloatingWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <QFrame>
35class QBoxLayout;
36
37#include <NDEVR/RibbonArea.h>
38namespace NDEVR
39{
40 class ContainerWidgetBase;
41 class InternalContentData;
42 class SectionContent;
43 class SectionTab;
44 class NDEVR_WIDGETS_API FloatingWidget : public QWidget
45 {
46 Q_OBJECT
47
48 friend class ContainerWidgetBase;
49
50 public:
51 FloatingWidget(ContainerWidgetBase* container, SectionContent* data, bool is_fullscreen, bool request_margins, QWidget* parent = nullptr);
52 virtual ~FloatingWidget();
53
54 SectionContent* content() const { return m_content; }
55 virtual void showEvent(QShowEvent * event) override;
56 virtual void hideEvent(QHideEvent* event) override;
57 void setRibbonArea(RibbonArea drop_area);
58 QSize sizeHint() const override;
59 void paintEvent(QPaintEvent* e) override;
60 void setRoundedCorners(int radius);
61 bool event(QEvent* event) override;
62 bool isDockedFullscreen() const;
63 void setDockedFullscreen(bool is_fullscreen);
64 public://private:
65 QPoint getDragLocation() const;
66 bool takeContent(SectionContent* data);
67 void setContent(SectionContent* data);
68 SectionTab* titleWidget() { return m_title_widget; }
69 private slots:
70 void onCloseButtonClicked();
71 protected:
72#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
73 bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result) override;
74#else
75 bool nativeEvent(const QByteArray& eventType, void* message, long* result) override;
76#endif
77 private:
78 RibbonArea m_ribbon_area;
79 ContainerWidgetBase* m_container;
80 SectionContent* m_content;
81 SectionTab* m_title_widget;
82 QWidget* m_content_widget;
83 QWidget* m_margin_widget = nullptr;
84 bool m_is_docked_full = false;
85 int m_corner_radius = 0;
86 };
87}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Definition ContainerWidget.h:85
Definition FloatingWidget.h:45
SectionContent * content() const
Definition FloatingWidget.h:54
SectionTab * titleWidget()
Definition FloatingWidget.h:68
Definition SectionContent.h:47
Definition SectionTab.h:44
Definition ACIColor.h:37
RibbonArea
Definition RibbonArea.h:68