|
KDDockWidgets API Documentation
1.5
|
Go to the documentation of this file.
23 #include "private/DockRegistry_p.h"
24 #include "private/DropAreaWithCentralFrame_p.h"
25 #include "private/DropArea_p.h"
26 #include "private/Frame_p.h"
27 #include "private/Logging_p.h"
28 #include "private/SideBar_p.h"
32 #include <QVBoxLayout>
40 class MyCentralWidget :
public QWidget
43 explicit MyCentralWidget(
QWidget *parent =
nullptr)
49 ~MyCentralWidget()
override;
53 class MainWindow::Private
56 explicit Private(MainWindowOptions,
MainWindow *mainWindow)
58 , m_supportsAutoHide(
Config::self().flags() &
Config::Flag_AutoHideSupport)
59 , m_centralWidget(new MyCentralWidget(mainWindow))
62 if (m_supportsAutoHide) {
65 m_sideBars.insert(location,
Config::self().frameworkWidgetFactory()->createSideBar(location, mainWindow));
69 m_layout->setSpacing(0);
75 m_layout->setContentsMargins(q->centerWidgetMargins());
79 const bool m_supportsAutoHide;
81 MyCentralWidget *
const m_centralWidget;
85 MyCentralWidget::~MyCentralWidget()
93 , d(new Private(options, this))
95 if (d->m_supportsAutoHide) {
98 innerVLayout->setSpacing(0);
99 innerVLayout->setContentsMargins(0, 0, 0, 0);
103 d->m_layout->addLayout(innerVLayout);
109 setCentralWidget(d->m_centralWidget);
124 void MainWindow::setCentralWidget(
QWidget *w)
131 return d->m_sideBars.value(location);
142 const QMargins margins = { 1, 5, 1, 1 };
143 return margins * logicalDpiFactor(
this);
QMargins centerWidgetMargins() const override
LayoutWidget * layoutWidget() const
void setCentralWidget(QWidget *widget)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QRect centralAreaGeometry() const override
void resizeEvent(QResizeEvent *) override
QWidget * centralWidget() const const
Application-wide config to tune certain behaviours of the framework.
void screenChanged(QScreen *screen)
QMainWindow sub-class to enable KDDockWidgets support.
The QMainwindow sub-class that the application should use to be able to dock KDDockWidget::DockWidget...
void setObjectName(const QString &name)
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
SideBar * sideBar(SideBarLocation) const override
returns the sidebar for the specified location
void onResized(QResizeEvent *)
~MainWindow() override
Destructor.
QObject * parent() const const
MainWindow(const QString &uniqueName, MainWindowOptions options=MainWindowOption_None, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Constructor. Use it as you would use QMainWindow.