File indexing completed on 2025-01-26 05:06:23
0001 /* 0002 SPDX-FileCopyrightText: 2014 Eike Hein <hein@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QPointer> 0010 #include <QQuickItem> 0011 0012 class WheelInterceptor : public QQuickItem 0013 { 0014 Q_OBJECT 0015 0016 Q_PROPERTY(QObject *destination READ destination WRITE setDestination NOTIFY destinationChanged) 0017 0018 public: 0019 explicit WheelInterceptor(QQuickItem *parent = nullptr); 0020 ~WheelInterceptor() override; 0021 0022 QObject *destination() const; 0023 void setDestination(QObject *destination); 0024 0025 Q_SIGNALS: 0026 void destinationChanged() const; 0027 0028 protected: 0029 void wheelEvent(QWheelEvent *event) override; 0030 0031 private: 0032 QPointer<QObject> m_destination; 0033 };