tests: Remove another usage of deprecated asQWidget()

This commit is contained in:
Sergio Martins
2022-04-19 19:14:58 +01:00
parent d5cec9f5de
commit d2b5bedfa1
3 changed files with 10 additions and 1 deletions

View File

@@ -304,3 +304,8 @@ DropArea *ViewWrapper_qtwidgets::asDropArea() const
{
return qobject_cast<DropArea *>(m_widget);
}
QWidget *ViewWrapper_qtwidgets::widget() const
{
return m_widget;
}

View File

@@ -58,6 +58,8 @@ public:
DropArea *asDropArea() const override;
QWidget *widget() const;
private:
QPointer<QWidget> m_widget;
};

View File

@@ -27,6 +27,7 @@
#include "controllers/DockWidget.h"
#include "controllers/MainWindow.h"
#include "qtwidgets/views/MainWindow_qtwidgets.h"
#include "qtwidgets/views/ViewWrapper_qtwidgets.h"
#include <QObject>
#include <QPushButton>
@@ -929,7 +930,8 @@ void TestQtWidgets::tst_negativeAnchorPositionWhenEmbedded()
layout->checkSanity();
delete m->window()->asQWidget();
auto wrapper = static_cast<Views::ViewWrapper_qtwidgets *>(m->window().get());
delete wrapper->widget();
}
void TestQtWidgets::tst_restoreResizesLayout()