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 #include "wheelinterceptor.h"
0008 
0009 #include <QCoreApplication>
0010 
0011 WheelInterceptor::WheelInterceptor(QQuickItem *parent)
0012     : QQuickItem(parent)
0013 {
0014 }
0015 
0016 WheelInterceptor::~WheelInterceptor()
0017 {
0018 }
0019 
0020 QObject *WheelInterceptor::destination() const
0021 {
0022     return m_destination;
0023 }
0024 
0025 void WheelInterceptor::setDestination(QObject *destination)
0026 {
0027     if (m_destination != destination) {
0028         m_destination = destination;
0029 
0030         Q_EMIT destinationChanged();
0031     }
0032 }
0033 
0034 void WheelInterceptor::wheelEvent(QWheelEvent *event)
0035 {
0036     if (m_destination) {
0037         QCoreApplication::sendEvent(m_destination, event);
0038     }
0039 }