Port away from QTest::qWaitForWindowActive, it's Qt specific
Simpliy moved it to Platform_qt
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <QWindow>
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
#include <QtTest/QTest>
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
@@ -52,3 +53,13 @@ std::shared_ptr<Window> Platform_qt::qobjectAsWindow(QObject *obj) const
|
||||
return windowFromQWindow(window);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef DOCKS_DEVELOPER_MODE
|
||||
|
||||
bool Platform_qt::tests_waitForWindowActive(Window::Ptr window, int timeout) const
|
||||
{
|
||||
auto windowqt = static_cast<Window_qt *>(window.get());
|
||||
return QTest::qWaitForWindowActive(windowqt->qtWindow(), timeout);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "docks_export.h"
|
||||
#include "Platform.h"
|
||||
#include "Window_qt.h"
|
||||
|
||||
namespace KDDockWidgets {
|
||||
|
||||
@@ -28,6 +29,10 @@ public:
|
||||
QVector<std::shared_ptr<Window>> windows() const override;
|
||||
std::shared_ptr<Window> qobjectAsWindow(QObject *) const override;
|
||||
virtual std::shared_ptr<Window> windowFromQWindow(QWindow *) const = 0;
|
||||
|
||||
#ifdef DOCKS_DEVELOPER_MODE
|
||||
bool tests_waitForWindowActive(std::shared_ptr<Window>, int timeout = 5000) const override;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user