Results 1 to 3 of 3

Thread: QwtPolarCurve setData()---help needed

  1. #1
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QwtPolarCurve setData()---help needed

    hi,
    im not able to set data in QwtPolarCurve. rather, im a little bit confused to use setData function in QwtPolarCurve. in QwtPlot, its easy to set data as there r enough overloading functions to set data. but the only option available in QwtPolarCurve to set data is setData(const QwtData &);. i referred demo example where RoseData and SpiralData curves r drawn. but i am not able to understand QwtData interfacing and not able to apply that derivation for my own derived class.

    my requirement is, i want to set my own curve containing set of radius and azimuth values. how can i set data like
    myPolarPlotCurve->setData(radius,azimuth). i tried to use QwtData interface, but im not succeeding, rather i am confused to how to assign set of radius and azimuth values.

    im putting problem in code form here.

    Qt Code:
    1. myPolarCurve->setData(MyQwtData(azAngle,radius,numPoints));
    To copy to clipboard, switch view to plain text mode 

    where MyQwtData is derived from QwtData.

    will u pls suggest how can i derive QwtData class to plot my own set of azimuth and radius values on QwtPolarCurve. pls put sample code, that will be of great help to me.

  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: QwtPolarCurve setData()---help needed

    You can use the same type of data classes for a QwtPolarCurve as for a QwtPlotCurve. Look in the Qwt docs which classes derived from QwtData are available. Of course you can also derive your own type of data class, but in most cases you don't need to.

    The x-value is the azimuth, the y value repesents the radius.

    Uwe

  3. #3
    Join Date
    Oct 2006
    Posts
    75
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtPolarCurve setData()---help needed

    thanks Uwe,

    ya, i derived the data class from QwtArrayData. it worked fine. thanks again..
    bye

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.