Results 1 to 2 of 2

Thread: QwtKnob - how to set the labels?

  1. #1
    Join Date
    Jan 2012
    Posts
    1
    Platforms
    Windows

    Default QwtKnob - how to set the labels?

    I have a set of label values for the knob. The knob is set from 0-11 in steps of 1.
    But each ticker on the knob needs to be labeled as given in a list { 1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32, 64, 128 }

    When I return the value selected on the knob I only need the values representing 0-11 which has been set on the scale. But I would like the user to read them as given in the above list. Hence the labeling has to be different from the actual values on the knob.

    Is there a way to do this?
    Thanks

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

    Default Re: QwtKnob - how to set the labels?

    Derive from QwtScaleDraw and re-implement YourScaleDraw::label(), where you return the strings ( mayby as rich text ) above. Then use QwtKnob::setScaleDraw().

    Uwe

Similar Threads

  1. QwtKnob and QwtLog10ScaleEngine
    By F. H. Saad in forum Newbie
    Replies: 1
    Last Post: 13th July 2011, 11:21
  2. Replies: 2
    Last Post: 17th April 2010, 16:48
  3. how to dynamically add labels
    By mohanakrishnan in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2009, 10:19
  4. rotated labels
    By jayw710 in forum Qt Programming
    Replies: 2
    Last Post: 11th April 2006, 17:47

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.