Results 1 to 7 of 7

Thread: Qt Polar Plot don't send correct Pole position...

  1. #1
    Join Date
    Mar 2016
    Posts
    19
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Exclamation Qt Polar Plot don't send correct Pole position...

    hi
    excuse me for bad English!
    i'm beginner in Qt Polar Plot and i need to calculate position of cursor in Polar screen so i use pole position.
    i map cursor position to widget position and i aum with polar screen that result have error!
    this error is change with change width/height!
    how solve this problem?

  2. #2
    Join Date
    Mar 2016
    Posts
    19
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Polar Plot don't send correct Pole position...

    Hi
    I fix this error with add two line in mapping cursor to polar screen:

    double dx=((QwtPolarPlot*)(m_polarWidget))->width()-canvasRect.width();
    double dy=((QwtPolarPlot*)(m_polarWidget))->height()-canvasRect.height();
    m_position=m_polarWidget->mapFromGlobal(QCursor:os());
    auto Position=QPointF(m_position.x()-(pole.x()+dx/2),(pole.y())-m_position.y())/(m_zoomScale.x()*scale);

    but i have another Question that is :
    this answer must scale in x/y to correct in polar screen,how find this scale number?
    Please Help me....
    thanks.

  3. #3
    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: Qt Polar Plot don't send correct Pole position...

    Mapping between polar and widget coordinates can be done using the QwtScaleMaps - see QwtPolarPlot::canvasMap(). But note the widget coordinates are positions of the plot canvas ( see QwtPolarPlot::canvas() ).

    Uwe

  4. #4
    Join Date
    Mar 2016
    Posts
    19
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Question Re: Qt Polar Plot don't send correct Pole position...

    thanks for answer me
    I try and go back...


    Added after 14 minutes:


    Hi again...
    i see two subject but :
    1- Can't find QwtPolarPlot::canvasMap() Function!
    2- I need to scale Global Position of cursor and do this for regular widget but for this widget i must calculate scale number to correct this process,in this progress,i can't find scale than normal render with painter!
    how solve this Ooops problem!
    please help me...
    thanks...
    Last edited by sampad1370; 8th March 2016 at 14:28.

  5. #5
    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: Qt Polar Plot don't send correct Pole position...

    It's QwtPolarMap::scaleMap().

    Uwe

  6. #6
    Join Date
    Mar 2016
    Posts
    19
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Polar Plot don't send correct Pole position...

    Hi
    thanks for help me.
    I Found this class but when i map shap in position(x,y) to polar plot screen,position don't correct!
    please show me with code and help me more please...
    thanks.

  7. #7
    Join Date
    Mar 2016
    Posts
    19
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Polar Plot don't send correct Pole position...

    Hi
    Thanks again for help me and reference me to solve this problem.
    I finally solve this problem.
    have good time.
    a.a

Similar Threads

  1. Replies: 8
    Last Post: 12th February 2015, 05:27
  2. Qwt Plot Picker as position indicator
    By Kutuska in forum Qwt
    Replies: 1
    Last Post: 7th September 2012, 15:01
  3. Replies: 10
    Last Post: 17th May 2011, 10:47
  4. Replies: 1
    Last Post: 27th February 2011, 09:15
  5. Replies: 7
    Last Post: 22nd September 2008, 23:05

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.