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 /**--------------------------------------------------------------------------------------------------
45 \brief Used with the NDEVR API Widget Docking system for widgets that are floating. These widgets
46 appear as windows within the application, though they are still managed by a ContainerWidget.
47 **/
48 class NDEVR_WIDGETS_API FloatingWidget : public QWidget
49 {
50 Q_OBJECT
51 friend class ContainerWidgetBase;
52 public:
53 FloatingWidget(ContainerWidgetBase* container, SectionContent* data, bool is_fullscreen, bool request_margins, QWidget* parent = nullptr);
54 virtual ~FloatingWidget();
55 SectionContent* content() const { return m_content; }
56 void setRibbonArea(RibbonArea drop_area);
57 void setRoundedCorners(int radius);
58 bool isDockedFullscreen() const;
59 void setDockedFullscreen(bool is_fullscreen);
60 QPoint getDragLocation() const;
63 SectionTab* titleWidget() { return m_title_widget; }
64 virtual QSize sizeHint() const override;
65 private slots:
66 void onCloseButtonClicked();
67 protected:
68 virtual void paintEvent(QPaintEvent* e) override;
69 virtual bool event(QEvent* event) override;
70 virtual void showEvent(QShowEvent* event) override;
71 virtual void hideEvent(QHideEvent* event) override;
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:59
The root class that manages a series of SectionContent that can share the same space or lay out in va...
Definition ContainerWidget.h:66
Used with the NDEVR API Widget Docking system for widgets that are floating. These widgets appear as ...
Definition FloatingWidget.h:49
virtual void hideEvent(QHideEvent *event) override
void setRoundedCorners(int radius)
virtual bool event(QEvent *event) override
bool takeContent(SectionContent *data)
virtual QSize sizeHint() const override
void setDockedFullscreen(bool is_fullscreen)
FloatingWidget(ContainerWidgetBase *container, SectionContent *data, bool is_fullscreen, bool request_margins, QWidget *parent=nullptr)
virtual void showEvent(QShowEvent *event) override
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override
SectionContent * content() const
Definition FloatingWidget.h:55
bool isDockedFullscreen() const
void setContent(SectionContent *data)
virtual void paintEvent(QPaintEvent *e) override
QPoint getDragLocation() const
void setRibbonArea(RibbonArea drop_area)
SectionTab * titleWidget()
Definition FloatingWidget.h:63
The core container for objects using the NDEVR API Widget Docking system. Contains information used t...
Definition SectionContent.h:51
Provides a tab that is used for either a tab if the section content is attached to a Container,...
Definition SectionTab.h:48
Definition ACIColor.h:37
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative to another widget.
Definition RibbonArea.h:71