Results 1 to 2 of 2

Thread: Use an image as QwtDialNeedle

  1. #1
    Join Date
    Oct 2017
    Qt products
    Qt4 Qt/Embedded

    Default Use an image as QwtDialNeedle

    I see Qwt comes with examples on QwtDial and QwtDialNeedle.
    I wonder if it's possible to use a custom image as QwtDialNeedle.
    I think it should be necessary to re-implement the virtual functions of QwtDialNeedle (draw, setPalette, drawNeedle, ...) and then it should work.

    Can someone confirm this, please?
    Is there a working example somewhere?


  2. #2
    Join Date
    Feb 2006
    Munich, Germany
    Thanked 823 Times in 772 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    MacOS X Unix/X11 Windows

    Default Re: Use an image as QwtDialNeedle

    Overloading the QwtDialNeedle::setPalette doesn't make much sense - you can't do much with it.
    QwtDialNeedle::draw sets up a transformation matrix, according to the direction and then calls drawNeedle, what should be o.k for your situation.

    So you only need to overload drawNeedle and maybe drawKnob - if you have such a thing.

    Of course you only will have results without aliasing effects, when using a vector graphics format like SVG - in case your type of dial rotates the needle.


Similar Threads

  1. Replies: 0
    Last Post: 10th February 2018, 11:40
  2. Replies: 1
    Last Post: 18th October 2015, 13:06
  3. Replies: 15
    Last Post: 24th July 2015, 23:33
  4. Replies: 3
    Last Post: 3rd August 2012, 11:35

Tags for this Thread


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.