Results 1 to 3 of 3

Thread: QwtKnob, how to obtain de startAngle and the spanAngle

  1. #1
    Join Date
    Feb 2010
    Location
    Cuba
    Posts
    35
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question QwtKnob, how to obtain de startAngle and the spanAngle

    how can I, given 2 values within the range defined for the widget knob, get the arc joining these 2 points?...I mean the starting angle and the spanAngle. I need it to use the fallowing function void QPainter::drawArc ( const QRect & rectangle, int startAngle, int spanAngle ).
    Thanks in advanced.

  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 obtain de startAngle and the spanAngle

    Good question, but looking into the code I can see: knob->scaleDraw()->scaleMap() returns the map, that is used to translate between angles and scale values. p1()/p2() are the min/max angles in degrees/16.

    Uwe

  3. #3
    Join Date
    Feb 2010
    Location
    Cuba
    Posts
    35
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QwtKnob, how to obtain de startAngle and the spanAngle

    What means the fallowing code lines:

    const int tval = map().transform(value);

    ( ... )

    const double arc = double(tval) / 16.0 * M_PI / 180.0;

    these lines are in the function void QwtRoundScaleDraw::drawTick(QPainter *painter, double value, int len) const

    perhaps arc is the angle corresponding to value parameter??

Similar Threads

  1. is it possible to obtain the svg data from QgraphicsSvgItem?
    By sanjayshelke in forum Qt Programming
    Replies: 7
    Last Post: 22nd February 2011, 14:50
  2. Replies: 5
    Last Post: 8th October 2008, 20:01
  3. How obtain QTextDocument height ?
    By jiveaxe in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2007, 08:27
  4. Replies: 4
    Last Post: 22nd March 2006, 11:16
  5. How to obtain the width of a QTableWidget?
    By Giel Peters in forum Qt Programming
    Replies: 3
    Last Post: 9th January 2006, 22:34

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