Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QWT oscilloscope example help
Qt 6.11 is out! See what's new in the release blog

QWT oscilloscope example help

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
2 Posts 1 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tamis2018
    wrote on last edited by
    #1

    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 );
    }
    

    };

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tamis2018
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved