Results 1 to 2 of 2

Thread: Help with changing axis scale with QwtSpectrogram

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Help with changing axis scale with QwtSpectrogram

    Quote Originally Posted by bubble View Post
    X-AXIS: 0 to 2048us with step 2us
    Y-AXIS: -2560 to 2560Hz with step 20Hz
    Then you have to write:

    Qt Code:
    1. DSPFunc::DSPFunc()
    2. {
    3. setInterval( Qt::XAxis, QwtInterval( 0.0, 2048.0 ) );
    4. setInterval( Qt::YAxis, QwtInterval( -2560, 2560 ) );
    5. }
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. double DSPFunc::value( double x, double y ) const
    2. {
    3. const int ix = x / 2;
    4. const int iy = ( 2560 + y ) / 20;
    5.  
    6. if ( ix < 0 || iy < 0 || ... )
    7. return qQNaN();
    8.  
    9. return Abs[ix][iy];
    10. }
    11.  
    12. QRectF DspFunc::pixelHint( const QRectF & ) const
    13. {
    14. return QRectF( 0.0, 0.0, 2.0, 20.0 );
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Uwe; 11th February 2014 at 21:36.

Similar Threads

  1. Replies: 1
    Last Post: 9th September 2013, 07:50
  2. Replies: 0
    Last Post: 18th January 2012, 07:41
  3. qwt axis scale
    By Markus_AC in forum Qwt
    Replies: 0
    Last Post: 15th December 2011, 09:45
  4. Replies: 4
    Last Post: 16th January 2011, 10:32
  5. Replies: 8
    Last Post: 25th April 2010, 21:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.