Added Platform::frontendTypes()

Needed by the tests
This commit is contained in:
Sergio Martins
2022-04-27 09:44:06 +01:00
parent 9fa80d2061
commit a2d17fd0b9
3 changed files with 22 additions and 1 deletions

View File

@@ -65,7 +65,9 @@ Q_ENUM_NS(MainWindowOptions)
enum class FrontendType enum class FrontendType
{ {
QtWidgets = 1, QtWidgets = 1,
QtQuick QtQuick,
FIRST = QtWidgets,
LAST = QtQuick // keep pointing to last
}; };
Q_ENUM_NS(FrontendType) Q_ENUM_NS(FrontendType)

View File

@@ -37,3 +37,15 @@ bool Platform::hasActivePopup() const
{ {
return false; return false;
} }
/**static*/
std::vector<KDDockWidgets::FrontendType> Platform::frontendTypes()
{
std::vector<KDDockWidgets::FrontendType> types;
types.reserve(int(FrontendType::LAST));
for (int i = int(FrontendType::FIRST); i <= int(FrontendType::LAST); ++i) {
types.push_back(FrontendType(i));
}
return types;
}

View File

@@ -13,10 +13,13 @@
#include "docks_export.h" #include "docks_export.h"
#include "ViewWrapper.h" #include "ViewWrapper.h"
#include "KDDockWidgets.h"
#include "kdbindings/signal.h" #include "kdbindings/signal.h"
#include <QEvent> #include <QEvent>
#include <vector>
#include <memory.h> #include <memory.h>
namespace KDDockWidgets { namespace KDDockWidgets {
@@ -70,6 +73,10 @@ public:
virtual QSize screenSizeFor(View *) const = 0; virtual QSize screenSizeFor(View *) const = 0;
#ifdef DOCKS_DEVELOPER_MODE #ifdef DOCKS_DEVELOPER_MODE
/// @brief list the list of frontend types supported by this build
static std::vector<KDDockWidgets::FrontendType> frontendTypes();
/// @brief Waits for the specified window to be active (have the keyboard focus) /// @brief Waits for the specified window to be active (have the keyboard focus)
/// Window::isActive() should return true /// Window::isActive() should return true
/// @sa Window::isActive() /// @sa Window::isActive()