Results 1 to 2 of 2

Thread: QwtDial.setOrigin() issue

  1. #1
    Join Date
    Oct 2017
    Posts
    25
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QwtDial.setOrigin() issue

    I create a custom QwtCustomDial wich inherits from QwtDial and I want to change the origin.
    In the constructor of my custom dial I call setOrigin() with different values 0.0, 180.0 and 270.0 but nothig changes in the appearance of the dial.
    It seems that the dafault origin of 90.0 is not modified.

    Is there someting wrong in my approach?


    Added after 35 minutes:


    I investigated a little bit deeper and I found that the scale changes when I change the origin.
    The problem is in the position where I draw the needle, but probably the draw() for the needle must be manually customized if I change the origin.


    Added after 24 minutes:


    Yes, problem fixed customizing properly draw() for thew needle.
    As per documentation, it uses the parameter 'directio' which is "Direction of the needle, in degrees counter clockwise"
    Last edited by vix; 1st March 2019 at 14:55.

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

    Default Re: QwtDial.setOrigin() issue

    Quote Originally Posted by vix View Post
    The problem is in the position where I draw the needle, but probably the draw() for the needle must be manually customized if I change the origin.
    Without knowing about your draw method - hard to say. But I would expect ( without checking it ), that the direction parameter of QwtDial::drawNeedle points to where the value on the corresponding scale is - in terms of a unit circle.

    Uwe

Similar Threads

  1. Needle for QwtDial
    By Pvr in forum Qwt
    Replies: 2
    Last Post: 28th June 2018, 20:09
  2. QwtDial and QThread
    By hassinoss in forum Qt Programming
    Replies: 3
    Last Post: 13th July 2014, 04:22
  3. QwtDial label
    By lvsteenson in forum Qwt
    Replies: 1
    Last Post: 21st December 2012, 09:17
  4. QWTDial problem
    By zaferaltug in forum Qwt
    Replies: 2
    Last Post: 20th November 2008, 16:40
  5. QwtDial not exits
    By hiuao in forum Qwt
    Replies: 1
    Last Post: 23rd August 2007, 10:22

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.