Minor decoupling between DropArea and DockWidgetBase
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include "Logging_p.h"
|
||||
#include "Utils_p.h"
|
||||
#include "DockRegistry_p.h"
|
||||
#include "DropArea_p.h"
|
||||
#include "Config.h"
|
||||
#include "TitleBar_p.h"
|
||||
#include "FrameworkWidgetFactory.h"
|
||||
@@ -133,7 +132,7 @@ void DockWidgetBase::addDockWidgetToContainingWindow(DockWidgetBase *other,
|
||||
d->morphIntoFloatingWindow();
|
||||
|
||||
if (auto fw = floatingWindow()) {
|
||||
fw->dropArea()->addDockWidget(other, location, relativeTo, initialOption);
|
||||
fw->addDockWidget(other, location, relativeTo, initialOption);
|
||||
} else {
|
||||
qWarning() << Q_FUNC_INFO << "Couldn't find floating nested window";
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
*/
|
||||
|
||||
#include "DebugWindow_p.h"
|
||||
#include "ObjectViewer_p.h"
|
||||
#include "DockRegistry_p.h"
|
||||
#include "FloatingWindow_p.h"
|
||||
#include "DropArea_p.h"
|
||||
#include "MainWindow.h"
|
||||
#include "LayoutSaver.h"
|
||||
#include "LayoutWidget_p.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ObjectViewer_p.h"
|
||||
#include "Qt5Qt6Compat_p.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
@@ -314,7 +314,7 @@ void DebugWindow::dumpDockWidgetInfo()
|
||||
|
||||
for (FloatingWindow *fw : floatingWindows) {
|
||||
qDebug() << fw << "; affinities=" << fw->affinities();
|
||||
fw->dropArea()->dumpLayout();
|
||||
fw->layoutWidget()->dumpLayout();
|
||||
}
|
||||
|
||||
for (MainWindowBase *mw : mainWindows) {
|
||||
|
||||
@@ -570,3 +570,9 @@ bool FloatingWindow::anyDockWidgetsHas(DockWidgetBase::LayoutSaverOption option)
|
||||
return frame->anyDockWidgetsHas(option);
|
||||
});
|
||||
}
|
||||
|
||||
void FloatingWindow::addDockWidget(DockWidgetBase *dw, Location location,
|
||||
DockWidgetBase *relativeTo, InitialOption option)
|
||||
{
|
||||
m_dropArea->addDockWidget(dw, location, relativeTo, option);
|
||||
}
|
||||
|
||||
@@ -152,6 +152,10 @@ public:
|
||||
///@brief Returns whether at least one dock widget has the specified layout saver option set
|
||||
bool anyDockWidgetsHas(DockWidgetBase::LayoutSaverOption) const;
|
||||
|
||||
/// @brief Adds the dock widget to the specified location
|
||||
void addDockWidget(DockWidgetBase *, KDDockWidgets::Location location,
|
||||
DockWidgetBase *relativeTo, InitialOption = {});
|
||||
|
||||
///@brief 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
|
||||
|
||||
Reference in New Issue
Block a user