KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
KDDockWidgets::Core::FloatingWindow Class Reference

#include <FloatingWindow.h>

Inheritance diagram for KDDockWidgets::Core::FloatingWindow:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::Core::FloatingWindow:
Collaboration graph
[legend]

Public Member Functions

 FloatingWindow (Core::Group *group, Rect suggestedGeometry, MainWindow *parent=nullptr)
 
 FloatingWindow (Rect suggestedGeometry, MainWindow *parent=nullptr, FloatingWindowFlags requestedFlags=FloatingWindowFlag::FromGlobalConfig)
 
virtual ~FloatingWindow () override
 
void addDockWidget (DockWidget *, KDDockWidgets::Location location, DockWidget *relativeTo, const InitialOption &={})
 Adds the dock widget to the specified location.
 
Vector< QStringaffinities () const
 
bool allDockWidgetsHave (DockWidgetOption) const
 Returns whether all dock widgets have the specified option set.
 
bool allDockWidgetsHave (LayoutSaverOption) const
 Returns whether all dock widgets have the specified layout saver option set.
 
bool anyDockWidgetsHas (DockWidgetOption) const
 Returns whether at least one dock widget has the specified option set.
 
bool anyDockWidgetsHas (LayoutSaverOption) const
 Returns whether at least one dock widget has the specified layout saver option set.
 
bool anyNonClosable () const
 
bool anyNonDockable () const
 
bool beingDeleted () const
 Returns whether a deleteLater has already been issued.
 
Margins contentMargins () const
 Returns the contents margins.
 
bool deserialize (const LayoutSaver::FloatingWindow &)
 
Vector< DockWidget * > dockWidgets () const
 
Private * dptr () const
 
Rect dragRect () const
 
DropAreadropArea () const
 
FloatingWindowFlags floatingWindowFlags () const
 Returns the per-floating window flags.
 
void focus (Qt::FocusReason reason)
 
Core::Group::List groups () const
 
bool hasSingleDockWidget () const
 checks if this FloatingWindow only has one dockwidget. This is a more specific case than hasSingleGroup(), it implies not only a single group, but that group must only have 1 dock widget.
 
bool hasSingleGroup () const
 checks if this FloatingWindow only has one group. If true it means there's no side-by-side dock widgets here. There's only 1 group. Note that despite having only 1 group it can still have multiple DockWidgets, as they can be tabbed into the single group.
 
bool isInDragArea (Point globalPoint) const
 Returns whether globalPoint is inside the title bar (or, when there's no title-bar, the draggable empty area of a tab bar)
 
bool isMDI () const override
 
bool isUtilityWindow () const
 Returns whether this window is a tool window Tool windows don't usually appear in the task bar.
 
bool isWindow () const override
 
WindowState lastWindowManagerState () const
 
Layoutlayout () const
 Returns the Layout.
 
MainWindowmainWindow () const
 Returns the MainWindow which is the transient parent of this FloatingWindow Can be nullptr if you create dock widgets before the main window. Can also be some arbitrary value if you have more than one main window.
 
std::unique_ptr< WindowBeingDragged > makeWindow () override
 
void maybeCreateResizeHandler ()
 
Core::DropAreamultiSplitter () const
 Returns the MultiSplitter.
 
void scheduleDeleteLater ()
 Equivalent to deleteLater() but sets beingDeleted() to true.
 
LayoutSaver::FloatingWindow serialize () const
 
void setLastWindowManagerState (WindowState)
 
void setSuggestedGeometry (Rect suggestedRect, SuggestedGeometryHints=SuggestedGeometryHint_None)
 Equivalent to setGeometry(), but the value might be adjusted.
 
Core::DockWidgetsingleDockWidget () const override final
 
Core::GroupsingleFrame () const
 If this floating window has only one Frame, it's returned, otherwise nullptr.
 
bool supportsMaximizeButton () const
 Returns whether this floating window supports showing a maximize button.
 
bool supportsMinimizeButton () const
 Returns whether this floating window supports showing a minimize button.
 
Core::TitleBartitleBar () const
 Returns the title bar.
 
void updateTitleAndIcon ()
 updates the title and the icon
 
void updateTitleBarVisibility ()
 
int userType () const
 
- Public Member Functions inherited from KDDockWidgets::Core::Controller
 Controller (ViewType type, View *)
 
virtual ~Controller ()
 
bool close ()
 
void destroyLater ()
 
Controller::Private * dptr () const
 
Rect geometry () const
 
int height () const
 
bool inDtor () const
 
bool is (ViewType) const
 Returns whether this controller is of the specified type.
 
bool isFixedHeight () const
 
bool isFixedWidth () const
 
bool isVisible () const
 
Point mapToGlobal (Point) const
 
Point pos () const
 
Rect rect () const
 
void setParentView (View *parent)
 
void setVisible (bool)
 
void show () const
 
Size size () const
 
ViewType type () const
 Returns the type of this controller.
 
Viewview () const
 Returns the view associated with this controller, if any.
 
int width () const
 
std::shared_ptr< Viewwindow () const
 
int x () const
 
int y () const
 

Static Public Member Functions

static void ensureRectIsOnScreen (Rect &geometry)
 

Static Public Attributes

static Qt::WindowFlags s_windowFlagsOverride = {}
 Allows the user app to specify which window flags to use, instead of KDDWs default ones Bugs caused by this won't be supported, as the amount of combinations that could go wrong can be open ended.
 

Protected Attributes

WindowState m_lastWindowManagerState = WindowState::None
 
Core::TitleBar *const m_titleBar
 
- Protected Attributes inherited from KDDockWidgets::Core::Controller
bool m_inDtor = false
 

Additional Inherited Members

- Protected Member Functions inherited from KDDockWidgets::Core::Controller
virtual void setParentView_impl (View *parent)
 

Detailed Description

Definition at line 35 of file core/FloatingWindow.h.

Constructor & Destructor Documentation

◆ FloatingWindow() [1/2]

FloatingWindow::FloatingWindow ( Rect  suggestedGeometry,
MainWindow parent = nullptr,
FloatingWindowFlags  requestedFlags = FloatingWindowFlag::FromGlobalConfig 
)
explicit

◆ FloatingWindow() [2/2]

FloatingWindow::FloatingWindow ( Core::Group group,
Rect  suggestedGeometry,
MainWindow parent = nullptr 
)
explicit

Definition at line 207 of file core/FloatingWindow.cpp.

◆ ~FloatingWindow()

FloatingWindow::~FloatingWindow ( )
overridevirtual

Member Function Documentation

◆ addDockWidget()

void FloatingWindow::addDockWidget ( Core::DockWidget dw,
KDDockWidgets::Location  location,
Core::DockWidget relativeTo,
const InitialOption option = {} 
)

◆ affinities()

Vector< QString > FloatingWindow::affinities ( ) const

◆ allDockWidgetsHave() [1/2]

bool FloatingWindow::allDockWidgetsHave ( DockWidgetOption  option) const

◆ allDockWidgetsHave() [2/2]

bool FloatingWindow::allDockWidgetsHave ( LayoutSaverOption  option) const

Returns whether all dock widgets have the specified layout saver option set.

Definition at line 659 of file core/FloatingWindow.cpp.

References groups().

◆ anyDockWidgetsHas() [1/2]

bool FloatingWindow::anyDockWidgetsHas ( DockWidgetOption  option) const

Returns whether at least one dock widget has the specified option set.

Definition at line 651 of file core/FloatingWindow.cpp.

References groups().

Referenced by c_KDDockWidgets__Core__FloatingWindow__anyDockWidgetsHas_DockWidgetOption(), and c_KDDockWidgets__Core__FloatingWindow__anyDockWidgetsHas_LayoutSaverOption().

◆ anyDockWidgetsHas() [2/2]

bool FloatingWindow::anyDockWidgetsHas ( LayoutSaverOption  option) const

Returns whether at least one dock widget has the specified layout saver option set.

Definition at line 667 of file core/FloatingWindow.cpp.

References groups().

◆ anyNonClosable()

bool FloatingWindow::anyNonClosable ( ) const

◆ anyNonDockable()

bool FloatingWindow::anyNonDockable ( ) const

◆ beingDeleted()

bool FloatingWindow::beingDeleted ( ) const

Returns whether a deleteLater has already been issued.

Definition at line 461 of file core/FloatingWindow.cpp.

References groups().

Referenced by c_KDDockWidgets__Core__FloatingWindow__beingDeleted(), KDDockWidgets::DockRegistry::floatingQWindows(), and KDDockWidgets::DockRegistry::floatingWindows().

◆ contentMargins()

Margins FloatingWindow::contentMargins ( ) const

Returns the contents margins.

Definition at line 696 of file core/FloatingWindow.cpp.

Referenced by c_KDDockWidgets__Core__FloatingWindow__contentMargins(), and setSuggestedGeometry().

◆ deserialize()

bool FloatingWindow::deserialize ( const LayoutSaver::FloatingWindow &  fw)

◆ dockWidgets()

Core::DockWidget::List FloatingWindow::dockWidgets ( ) const

Definition at line 324 of file core/FloatingWindow.cpp.

◆ dptr()

FloatingWindow::Private * FloatingWindow::dptr ( ) const

Definition at line 796 of file core/FloatingWindow.cpp.

Referenced by KDDockWidgets::Core::TitleBar::TitleBar().

◆ dragRect()

Rect FloatingWindow::dragRect ( ) const

◆ dropArea()

DropArea * FloatingWindow::dropArea ( ) const

◆ ensureRectIsOnScreen()

void FloatingWindow::ensureRectIsOnScreen ( Rect &  geometry)
static

◆ floatingWindowFlags()

FloatingWindowFlags FloatingWindow::floatingWindowFlags ( ) const

Returns the per-floating window flags.

Definition at line 791 of file core/FloatingWindow.cpp.

◆ focus()

void FloatingWindow::focus ( Qt::FocusReason  reason)

◆ groups()

Core::Group::List FloatingWindow::groups ( ) const

◆ hasSingleDockWidget()

bool FloatingWindow::hasSingleDockWidget ( ) const

checks if this FloatingWindow only has one dockwidget. This is a more specific case than hasSingleGroup(), it implies not only a single group, but that group must only have 1 dock widget.

Returns
true if this FloatingWindow only has one dockwidget.

Definition at line 445 of file core/FloatingWindow.cpp.

References KDDockWidgets::Core::Group::dockWidgetCount(), KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::first(), groups(), and KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::size().

Referenced by c_KDDockWidgets__Core__FloatingWindow__hasSingleDockWidget().

◆ hasSingleGroup()

bool FloatingWindow::hasSingleGroup ( ) const

checks if this FloatingWindow only has one group. If true it means there's no side-by-side dock widgets here. There's only 1 group. Note that despite having only 1 group it can still have multiple DockWidgets, as they can be tabbed into the single group.

Returns
true if this FloatingWindow has a single group.

Definition at line 440 of file core/FloatingWindow.cpp.

Referenced by c_KDDockWidgets__Core__FloatingWindow__hasSingleGroup(), dragRect(), KDDockWidgets::Core::TitleBar::tabBar(), updateTitleAndIcon(), and updateTitleBarVisibility().

◆ isInDragArea()

bool FloatingWindow::isInDragArea ( Point  globalPoint) const

Returns whether globalPoint is inside the title bar (or, when there's no title-bar, the draggable empty area of a tab bar)

Definition at line 407 of file core/FloatingWindow.cpp.

References dragRect().

Referenced by c_KDDockWidgets__Core__FloatingWindow__isInDragArea_Point().

◆ isMDI()

bool FloatingWindow::isMDI ( ) const
override

Definition at line 681 of file core/FloatingWindow.cpp.

◆ isUtilityWindow()

bool FloatingWindow::isUtilityWindow ( ) const

Returns whether this window is a tool window Tool windows don't usually appear in the task bar.

Definition at line 785 of file core/FloatingWindow.cpp.

References KDDockWidgets::DontUseParentForFloatingWindows, and KDDockWidgets::UseQtWindow.

Referenced by c_KDDockWidgets__Core__FloatingWindow__isUtilityWindow(), and KDDockWidgets::Core::TitleBar::onMinimizeClicked().

◆ isWindow()

bool FloatingWindow::isWindow ( ) const
override

Definition at line 686 of file core/FloatingWindow.cpp.

◆ lastWindowManagerState()

WindowState FloatingWindow::lastWindowManagerState ( ) const

Definition at line 701 of file core/FloatingWindow.cpp.

References m_lastWindowManagerState.

◆ layout()

Layout * FloatingWindow::layout ( ) const

Returns the Layout.

Definition at line 402 of file core/FloatingWindow.cpp.

Referenced by c_KDDockWidgets__Core__FloatingWindow__layout().

◆ mainWindow()

MainWindow * FloatingWindow::mainWindow ( ) const

Returns the MainWindow which is the transient parent of this FloatingWindow Can be nullptr if you create dock widgets before the main window. Can also be some arbitrary value if you have more than one main window.

Definition at line 691 of file core/FloatingWindow.cpp.

References KDDockWidgets::Core::View::parentView(), and KDDockWidgets::Core::Controller::view().

Referenced by c_KDDockWidgets__Core__FloatingWindow__mainWindow().

◆ makeWindow()

std::unique_ptr< WindowBeingDragged > FloatingWindow::makeWindow ( )
override

Definition at line 307 of file core/FloatingWindow.cpp.

◆ maybeCreateResizeHandler()

void FloatingWindow::maybeCreateResizeHandler ( )

◆ multiSplitter()

Core::DropArea * FloatingWindow::multiSplitter ( ) const

◆ scheduleDeleteLater()

void FloatingWindow::scheduleDeleteLater ( )

◆ serialize()

LayoutSaver::FloatingWindow FloatingWindow::serialize ( ) const

◆ setLastWindowManagerState()

void FloatingWindow::setLastWindowManagerState ( WindowState  state)

Definition at line 770 of file core/FloatingWindow.cpp.

References m_lastWindowManagerState.

◆ setSuggestedGeometry()

void FloatingWindow::setSuggestedGeometry ( Rect  suggestedRect,
SuggestedGeometryHints  hint = SuggestedGeometryHint_None 
)

◆ singleDockWidget()

Core::DockWidget * FloatingWindow::singleDockWidget ( ) const
finaloverride

◆ singleFrame()

Core::Group * FloatingWindow::singleFrame ( ) const

◆ supportsMaximizeButton()

bool FloatingWindow::supportsMaximizeButton ( ) const

Returns whether this floating window supports showing a maximize button.

Definition at line 780 of file core/FloatingWindow.cpp.

References KDDockWidgets::TitleBarHasMaximizeButton.

Referenced by c_KDDockWidgets__Core__FloatingWindow__supportsMaximizeButton(), and KDDockWidgets::Core::TitleBar::supportsMaximizeButton().

◆ supportsMinimizeButton()

bool FloatingWindow::supportsMinimizeButton ( ) const

Returns whether this floating window supports showing a minimize button.

Definition at line 775 of file core/FloatingWindow.cpp.

References KDDockWidgets::TitleBarHasMinimizeButton.

Referenced by c_KDDockWidgets__Core__FloatingWindow__supportsMinimizeButton(), and KDDockWidgets::Core::TitleBar::supportsMinimizeButton().

◆ titleBar()

Core::TitleBar * KDDockWidgets::Core::FloatingWindow::titleBar ( ) const
inline

Returns the title bar.

This TitleBar is hidden if we're using a native title bar.

Definition at line 77 of file core/FloatingWindow.h.

Referenced by c_KDDockWidgets__Core__FloatingWindow__titleBar(), KDDockWidgets::Core::TitleBar::makeWindow(), and KDDockWidgets::QtQuick::FloatingWindow::titleBar().

◆ updateTitleAndIcon()

void FloatingWindow::updateTitleAndIcon ( )

◆ updateTitleBarVisibility()

void FloatingWindow::updateTitleBarVisibility ( )

◆ userType()

int FloatingWindow::userType ( ) const

Definition at line 706 of file core/FloatingWindow.cpp.

References singleFrame().

Referenced by c_KDDockWidgets__Core__FloatingWindow__userType().

Member Data Documentation

◆ m_lastWindowManagerState

WindowState KDDockWidgets::Core::FloatingWindow::m_lastWindowManagerState = WindowState::None
protected

Definition at line 213 of file core/FloatingWindow.h.

Referenced by lastWindowManagerState(), and setLastWindowManagerState().

◆ m_titleBar

Core::TitleBar* const KDDockWidgets::Core::FloatingWindow::m_titleBar
protected

◆ s_windowFlagsOverride

Qt::WindowFlags FloatingWindow::s_windowFlagsOverride = {}
static

Allows the user app to specify which window flags to use, instead of KDDWs default ones Bugs caused by this won't be supported, as the amount of combinations that could go wrong can be open ended.

static

Definition at line 191 of file core/FloatingWindow.h.

Referenced by windowFlagsToUse().


The documentation for this class was generated from the following files:

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8