Results 1 to 5 of 5

Thread: Can I Add two needle for QwtDial

  1. #1
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Can I Add two needle for QwtDial

    hi, I want to add new needle for qwtDial because I need to show two needle in qwtDial but setNeedle method takes one needle .How can I do that.

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

    Default Re: Can I Add two needle for QwtDial

    You have to derive from QwtDial and implement the second needle feature.

    What exactly needs to be done depends on what you want to do with the second needle. If it is only about displaying a value it might be enough to do it in YourDial::drawContents.

    Uwe

  3. #3
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can I Add two needle for QwtDial

    Quote Originally Posted by Uwe View Post
    You have to derive from QwtDial and implement the second needle feature.

    What exactly needs to be done depends on what you want to do with the second needle. If it is only about displaying a value it might be enough to do it in YourDial::drawContents.

    Uwe
    I want to display two value so I need two needles in a qwtdial .I implement drawContents but it does not work if you have sample code .can you share it.Thanks

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,258
    Thanked 862 Times in 811 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Can I Add two needle for QwtDial

    Copy the code in QwtDial::drawContents, that deals with calculating the parameters of the drawNeedle call. Then add this code like this:

    Qt Code:
    1. virtual void YourDial::drawContents(...)
    2. {
    3. QwtDial::drawContents(...);
    4.  
    5. // now calculate the parameters for your second
    6. // needle
    7. ...
    8. drawNeedle(...);
    9. }
    To copy to clipboard, switch view to plain text mode 

    Uwe

  5. #5
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can I Add two needle for QwtDial

    Quote Originally Posted by Uwe View Post
    Copy the code in QwtDial::drawContents, that deals with calculating the parameters of the drawNeedle call. Then add this code like this:

    Qt Code:
    1. virtual void YourDial::drawContents(...)
    2. {
    3. QwtDial::drawContents(...);
    4.  
    5. // now calculate the parameters for your second
    6. // needle
    7. ...
    8. drawNeedle(...);
    9. }
    To copy to clipboard, switch view to plain text mode 

    Uwe

    Thaks for all replies . if You have a demo .Can you share if yo do I appreciate so much .I try but I can not do.

Similar Threads

  1. How can I draw needle for dial in Qwt
    By validator in forum Qwt
    Replies: 6
    Last Post: 3rd February 2008, 21:27
  2. How can I resize needle of QDial
    By validator in forum Qt Tools
    Replies: 1
    Last Post: 1st February 2008, 11:10
  3. setting needle size in qwtCompass
    By user in forum Qwt
    Replies: 4
    Last Post: 23rd July 2007, 00:40

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.