Add EventFilterInterface and port DockRegistry to it

Some classes wont have any Qt in it, so they need another way
to install global event filters. Added API to Platform.h for this
purpose. Implemented as regular event filter in Platform_qt.
This commit is contained in:
Sergio Martins
2022-07-01 15:25:48 +01:00
parent a690477b73
commit c72fdf3586
8 changed files with 120 additions and 13 deletions

View File

@@ -0,0 +1,33 @@
/*
This file is part of KDDockWidgets.
SPDX-FileCopyrightText: 2020-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Sérgio Martins <sergio.martins@kdab.com>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#pragma once
#include <memory>
namespace KDDockWidgets {
class Window;
class View;
class EventFilterInterface
{
public:
virtual ~EventFilterInterface();
/// @brief Override to handle expose events for a certain window
virtual bool onExposeEvent(std::shared_ptr<Window>)
{
return false;
}
};
}