Make it easier for tests to init the platform

Only a single static method is needed now, instead of 2.
This commit is contained in:
Sergio Martins
2022-04-29 14:31:09 +01:00
parent 34b07ef340
commit 099a9018df
10 changed files with 46 additions and 30 deletions

View File

@@ -175,15 +175,14 @@ void Platform_qt::tests_sendEvent(Window::Ptr window, QEvent *ev) const
qApp->sendEvent(static_cast<Window_qt *>(window.get())->qtWindow(), ev);
}
void Platform_qt::tests_initTests()
void Platform_qt::tests_initPlatform_impl()
{
qApp->setOrganizationName(QStringLiteral("KDAB"));
qApp->setApplicationName(QStringLiteral("dockwidgets-unit-tests"));
}
void Platform_qt::tests_cleanupTests()
void Platform_qt::tests_deinitPlatform_impl()
{
Platform::tests_cleanupTests();
}
#endif

View File

@@ -42,8 +42,8 @@ public:
bool tests_waitForResize(Controller *, int timeout = 2000) const override;
bool tests_waitForDeleted(View *, int timeout = 2000) const override;
void tests_sendEvent(std::shared_ptr<Window>, QEvent *) const override;
void tests_initTests() override;
void tests_cleanupTests() override;
void tests_initPlatform_impl() override;
void tests_deinitPlatform_impl() override;
#endif
protected:
int screenNumberForQWindow(QWindow *) const;