Added MainWindow::internalLayout()

Allows the application to add more widgets next to the drop area.
This commit is contained in:
Sergio Martins
2022-06-08 16:31:35 +01:00
parent 189fc7356a
commit 74dcbd994a
3 changed files with 16 additions and 3 deletions

View File

@@ -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"

View File

@@ -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;
}

View File

@@ -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;