Results 1 to 17 of 17

Thread: Customize tick labels in a QwtSlider

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Customize tick labels in a QwtSlider

    Qt Code:
    1. class YourScaleDraw: public QwtScaleDraw
    2. {
    3. public:
    4. virtual QwtText label( double value ) const
    5. {
    6. return QwtScaleDraw::label( value / 1000.0 );
    7. }
    8. };
    9.  
    10. ui.timeSampleSlider->setScaleDraw( new YourScaleDraw() );
    To copy to clipboard, switch view to plain text mode 
    Assigning the YourScaleDraw object has to be done before you set the ticks !

    But please stay to Qwt related questions, when posting here. There are other forums dedicated to C++.

    Uwe

  2. The following user says thank you to Uwe for this useful post:

    RomanRdgz (10th September 2012)

Similar Threads

  1. How to hide tick labels
    By ken123 in forum Qwt
    Replies: 1
    Last Post: 24th November 2011, 07:15
  2. Y Axis tick labels cut off on left
    By rbergeron in forum Qwt
    Replies: 2
    Last Post: 4th November 2011, 14:29
  3. Axis Tick Labels Overlap
    By amoswood in forum Qwt
    Replies: 3
    Last Post: 8th June 2010, 15:52
  4. y-axis tick labels trimmed
    By gib in forum Qwt
    Replies: 2
    Last Post: 2nd April 2010, 05:19
  5. Tick Labels for Slider
    By jcraig in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 17:21

Tags for this Thread

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.