diff --git a/Changelog b/Changelog index 9686f0ec..ea88c56e 100644 --- a/Changelog +++ b/Changelog @@ -11,6 +11,7 @@ - X11: Fixed dragging a maximized floating window. Its size is now restored to normal size when the drag starts. - Added DockWidgetBase::currentTabIndex() - Added InitialVisibilityOption::PreserveCurrentTab + - Added MainWindow::internalLayout() for advanced customization * v1.5.0 (24 November 2021) - Install the Python bindings to "site-packages" diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 8bae2e8d..01dc527c 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -84,9 +84,7 @@ public: QMargins m_centerWidgetMargins = { 1, 5, 1, 1 }; }; -MyCentralWidget::~MyCentralWidget() -{ -} +MyCentralWidget::~MyCentralWidget() = default; MainWindow::MainWindow(const QString &name, MainWindowOptions options, @@ -172,3 +170,8 @@ void MainWindow::closeEvent(QCloseEvent *ev) { onCloseEvent(ev); } + +QHBoxLayout *MainWindow::internalLayout() const +{ + return d->m_layout; +} diff --git a/src/MainWindow.h b/src/MainWindow.h index dd9c6f50..e96d46f8 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -21,6 +21,10 @@ #include "MainWindowBase.h" +QT_BEGIN_NAMESPACE +class QHBoxLayout; +QT_END_NAMESPACE + namespace KDDockWidgets { class SideBar; @@ -56,6 +60,11 @@ public: //@brief sets the margins for the contents widgets void setCenterWidgetMargins(const QMargins &margins); + ///@brief returns the internal layout + /// this is rarely needed unless you want to layout other widgets next to the + /// main dock widget layout + QHBoxLayout *internalLayout() const; + protected: void closeEvent(QCloseEvent *) override; void resizeEvent(QResizeEvent *) override;