14#include "kddockwidgets/core/DockWidget.h"
15#include "kddockwidgets/core/MainWindow.h"
16#include "kddockwidgets/core/DockRegistry.h"
37 if (name != m_uniqueName) {
63 return m_mainWindow && m_mainWindow->
isMDI();
67 QQuickItem *relativeTo,
QSize initialSize,
70 if (!dockWidget || !m_mainWindow)
77 qWarning() <<
"MainWindowInstantiator::addDockWidget: Could not find dockwidget";
83 m_mainWindow->
addDockWidget(dw, location, relativeToDw, { option, initialSize });
88 if (!dockWidget || !m_mainWindow)
103 if (!m_mainWindow || !dockWidget)
112 if (!m_mainWindow || !dockWidget)
121 if (!m_mainWindow || !dockWidget)
130 if (!m_mainWindow || !dockWidget)
139 if (!m_mainWindow || !dockWidget)
148 if (!m_mainWindow || !dockWidget)
184 qWarning() << Q_FUNC_INFO
185 <<
"Each DockWidget need an unique name. Set the uniqueName property.";
195 qWarning() << Q_FUNC_INFO <<
"Name can't be empty";
200 qWarning() << Q_FUNC_INFO <<
"Main window is already initialized";
204 const auto mainWindowOptions = MainWindowOptions(m_options);
bool sideBarIsVisible(KDDockWidgets::SideBarLocation location) const
Returns whether the specified sidebar is visible.
void clearSideBarOverlay(bool deleteFrame=true)
closes any overlayed dock widget. The sidebar still displays them as button.
void addDockWidgetAsTab(KDDockWidgets::Core::DockWidget *dockwidget)
Docks a DockWidget into the central group, tabbed.
void overlayOnSideBar(KDDockWidgets::Core::DockWidget *dw)
Shows the dock widget overlayed on top of the main window, placed next to the sidebar.
void toggleOverlayOnSideBar(KDDockWidgets::Core::DockWidget *dw)
Shows or hides an overlay. It's assumed the dock widget is already in a side-bar.
void layoutParentContainerEqually(KDDockWidgets::Core::DockWidget *dockWidget)
like layoutEqually() but starts with the container that has dockWidget. While layoutEqually() starts ...
void addDockWidget(KDDockWidgets::Core::DockWidget *dockWidget, KDDockWidgets::Location location, KDDockWidgets::Core::DockWidget *relativeTo=nullptr, KDDockWidgets::InitialOption initialOption={})
Docks a DockWidget into this main window.
void layoutEqually()
layouts all the widgets so they have an equal size within their parent container
void moveToSideBar(KDDockWidgets::Core::DockWidget *dw)
Moves the dock widget into one of the MainWindow's sidebar. Means the dock widget is removed from the...
bool closeDockWidgets(bool force=false)
Closes all dock widgets which are docked into this main window This is convenience to calling DockWid...
bool isMDI() const
Returns whether this main window is using an MDI layout. In other words, returns true if MainWindowOp...
Vector< QString > affinities() const
Returns the list of affinity names. Empty by default.
void restoreFromSideBar(KDDockWidgets::Core::DockWidget *dw)
Removes the dock widget from the sidebar and docks it into the main window again.
QVector< QString > affinities
Q_INVOKABLE void moveToSideBar(QQuickItem *)
Q_INVOKABLE void addDockWidget(QQuickItem *dockWidget, KDDockWidgets::Location location, QQuickItem *relativeTo=nullptr, QSize initialSize={}, KDDockWidgets::InitialVisibilityOption={})
See KDDockWidgets::Core::MainWindow::addDockWidget()
Q_INVOKABLE void restoreFromSideBar(QQuickItem *)
Q_INVOKABLE void addDockWidgetAsTab(QQuickItem *dockWidget)
See KDDockWidgets::Core::MainWindow::addDockWidgetAsTab()
Q_INVOKABLE void layoutParentContainerEqually(QQuickItem *dockWidget)
Q_INVOKABLE void overlayOnSideBar(QQuickItem *)
Q_INVOKABLE bool closeDockWidgets(bool force=false)
Q_INVOKABLE bool sideBarIsVisible(KDDockWidgets::SideBarLocation) const
KDDockWidgets::MainWindowOptions options
Q_INVOKABLE void clearSideBarOverlay(bool deleteFrame=true)
MainWindowInstantiator()
ctor, called by QML engine
void classBegin() override
void setUniqueName(const QString &)
void componentComplete() override
Q_INVOKABLE void toggleOverlayOnSideBar(QQuickItem *)
Q_INVOKABLE void layoutEqually()
void setOptions(KDDockWidgets::MainWindowOptions)
MainWindow sub-class which uses MDI as a layout.
A docking area for dock widgets Named MainWindow as it's the QtWidgets/QMainWindow counterpart....
bool isEmpty() const const