DockWidget: decouple more from QtWidgets

This commit is contained in:
Sergio Martins
2022-04-03 20:06:31 +01:00
parent a70b419c34
commit 79f9f72ef4
6 changed files with 53 additions and 6 deletions

View File

@@ -17,6 +17,7 @@
#include "controllers/Stack.h"
#include "controllers/TitleBar.h"
#include "controllers/TabBar.h"
#include "controllers/MainWindow.h"
#include <QWidget> // TODOv2 remove
@@ -229,6 +230,14 @@ Controllers::DockWidget *View::asDockWidgetController() const
return nullptr;
}
Controllers::MainWindow *View::asMainWindowController() const
{
if (m_controller && m_controller->is(Type::MainWindow))
return qobject_cast<Controllers::MainWindow *>(m_controller);
return nullptr;
}
bool View::equals(const View *other) const
{
return other && handle() == other->handle();