/* This file is part of KDDockWidgets. SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company Author: Sérgio Martins SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only Contact KDAB at for commercial licensing options. */ #pragma once #include "docks_export.h" #include "Platform.h" #include "Window_qt.h" namespace KDDockWidgets { /// @brief Baseclass platform for Qt based platform /// Useful since QtWidgets and QtQuick share some similarities class DOCKS_EXPORT Platform_qt : public Platform { public: Platform_qt(); ~Platform_qt() override; std::shared_ptr focusedView() const override; QVector> windows() const override; std::shared_ptr qobjectAsWindow(QObject *) const override; virtual std::shared_ptr windowFromQWindow(QWindow *) const = 0; int screenNumberFor(std::shared_ptr) const override; void sendEvent(View *, QEvent *) const override; #ifdef DOCKS_DEVELOPER_MODE bool tests_waitForWindowActive(std::shared_ptr, int timeout = 5000) const override; bool tests_waitForEvent(QObject *w, QEvent::Type type, int timeout = 5000) const override; bool tests_waitForEvent(View *, QEvent::Type type, int timeout = 5000) const override; bool tests_waitForEvent(std::shared_ptr, QEvent::Type type, int timeout = 5000) const override; bool tests_waitForResize(View *, int timeout = 2000) const override; bool tests_waitForResize(Controller *, int timeout = 2000) const override; bool tests_waitForDeleted(View *, int timeout = 2000) const override; void tests_sendEvent(std::shared_ptr, QEvent *) const override; void tests_initPlatform_impl() override; void tests_deinitPlatform_impl() override; #endif protected: int screenNumberForQWindow(QWindow *) const; }; }