QWT oscilloscope example help



  • QWT oscilloscope example - wheelbox.cpp. Please see code bellow. I could not understand that. That means that whenever I scroll the
    mouse it will, generate QEvent::Wheel, then event will be modified only with QPoint( 5, 5 )
    (possibly to put mouse on 5,5 coordinate? After the event will be sent to this object which is Wheel class instance? Why?

    virtual bool eventFilter( QObject *object, QEvent *event )

    {
    
        if ( event->type() == QEvent::Wheel )
    
        {
    
            QWheelEvent *we = ( QWheelEvent * )event
    
            QWheelEvent wheelEvent( QPoint( 5, 5 ), we->delta(),
    
                we->buttons(), we->modifiers(),
    
                we->orientation() );
    
            QApplication::sendEvent( this, &wheelEvent );
    
            return true;
    
        }
    
        return QwtWheel::eventFilter( object, event );
    }
    

    };



  • Exactly, why we have to include this:

    QWheelEvent wheelEvent( QPoint( 5, 5 ), we->delta(),

                we->buttons(), we->modifiers(),
    
                we->orientation() );
    

    QPoint( 5, 5 ) is pos or global pos?

    What is pixelDelta? What does mean that it contains the scrolling distance in pixels
    on screen?


 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.