diff --git a/input.cpp b/input.cpp index 8241d3c8fa..d5a0c55732 100644 --- a/input.cpp +++ b/input.cpp @@ -1882,11 +1882,6 @@ bool InputRedirection::isBreakingPointerConstraints() const return m_pointerConstraintsFilter ? m_pointerConstraintsFilter->isActive() : false; } -void InputRedirection::processFilters(std::function function) -{ - std::any_of(m_filters.constBegin(), m_filters.constEnd(), function); -} - InputDeviceHandler::InputDeviceHandler(InputRedirection *input) : QObject(input) , m_input(input) diff --git a/input.h b/input.h index dd41dcafac..575a2c6d16 100644 --- a/input.h +++ b/input.h @@ -173,10 +173,19 @@ public: * The method @p function is invoked on each input filter. Processing is stopped if * a filter returns @c true for @p function. * + * The UnaryPredicate is defined like the UnaryPredicate of std::any_of. + * The signature of the function should be equivalent to the following: + * @code + * bool function(const InputEventFilter *spy); + * @endcode + * * The intended usage is to std::bind the method to invoke on the filter with all arguments * bind. **/ - void processFilters(std::function function); + template + void processFilters(UnaryPredicate function) { + std::any_of(m_filters.constBegin(), m_filters.constEnd(), function); + } /** * Sends an event through all input event spies.