Port LayoutWidget away from QWidget

DropArea and MDILayout now inherit from it, in addittion to QWidget.
This mean DropArea can now be split into View/Controller alone,
without having to port LayoutWidget and MDILayout in the same commit,
which would be hard to review.
This commit is contained in:
Sergio Martins
2022-04-24 12:57:20 +01:00
parent b08c49e788
commit 6ebb432932
27 changed files with 190 additions and 115 deletions

View File

@@ -154,11 +154,8 @@ bool Frame_qtwidgets::event(QEvent *e)
return QWidget::event(e);
if (e->type() == QEvent::ParentChange) {
if (auto layoutWidget = qobject_cast<LayoutWidget *>(QWidget::parentWidget())) {
m_controller->setLayoutWidget(layoutWidget);
} else {
m_controller->setLayoutWidget(nullptr);
}
auto p = parentView();
m_controller->setLayoutWidget(p ? p->asLayoutWidget() : nullptr);
}
return QWidget::event(e);