Results 1 to 3 of 3

Thread: Qwt 5.2.1 to 6.0.1

  1. #1
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Qwt 5.2.1 to 6.0.1

    Greetings,

    I have been tasked with porting our qwt libs to a newer version.
    I noticed there was a lack of any guide to accomplish that port easily, (unless I did not look well enough) so if anyone could help me with that I would be very thankful.

    Now, it was not I who developped our qwt components. I have never used qwt myself, but I know Qt decently. I tried to look up the changes and understand how to port, but for some questions I have not found any answer.

    Summary:
    We currently use qwt to make an histogram and a color scale (choose a color range from black-lowest value to white-highest value with the middle being decided by the chosen color palette). From what i've gathered, we made our own class descending from QwtPlotItem and built our draw function for the histogram. Both the color scale and the histogram are in separate dock widgets.
    I am aware of the new qwt_plot_histogram class but I am unaware of how to port it without starting from scratch considering the draw function was made by us.
    We mainly used QwtIntervalData to build the histogram,

    Some changes I don't understand/questions:
    -QwtIntervalData --> Where is it gone? What is the correct replacement for this class?
    -Qwt_compat only redefines qwt objects as qtobjects : qwt_double_rect ---> QRectF . Is this true? If so, I could just change the vars directly in the code.
    -With the new qwtPlotHistogram class, would it be possible to use a custom made color palette to display the histogram? (Example: the histogram needs to have a color gradient instead of being uniform in terms of color)

    Changes I made:
    -Took the svn version of qwt_compat_h instead of the 6.0.1 version
    -Removed bad inclusions and added qwt_compat
    -Changed QwtIntervalData to QwtInterval. This is my main problem.

    Additional info :
    -We use Qt 4.7.4
    -We have libqxt 6.0.2

    Can anyone help me by clarifying these things for me? I'm also willing to take any advice on the porting!
    Thanks in advance,
    -WSQt

  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: Qwt 5.2.1 to 6.0.1

    Quote Originally Posted by WSQtProgrammer View Post
    We currently use qwt to make an histogram and a color scale (choose a color range from black-lowest value to white-highest value with the middle being decided by the chosen color palette).
    Is it really a histogram or a bar chart ? If it is a bar chart stop reading here and check SVN trunk instead.

    Quote Originally Posted by WSQtProgrammer View Post
    I am aware of the new qwt_plot_histogram class but I am unaware of how to port it without starting from scratch considering the draw function was made by us.
    Well, if all what your code does is to draw columns filled with a gradient I recommend to throw it away and start from scratch. With QwtPlotHistogram only a couple of lines would be left - something that can be implemented ( or copied out from your code ) in 10 minutes.

    QwtIntervalData --> Where is it gone? What is the correct replacement for this class?
    QwtSeriesData<QwtIntervalSample>, but I guess you will prefer to use a more convenient API, that internally creates such an object:
    Qt Code:
    1. void QwtPlotHistogram::setSamples( const QVector<QwtIntervalSample> & );
    To copy to clipboard, switch view to plain text mode 
    -Qwt_compat only redefines qwt objects as qtobjects : qwt_double_rect ---> QRectF . Is this true? If so, I could just change the vars directly in the code.
    Yes, Qwt 6 doesn't support Qt3 anymore and these wrapper classes are obsolete. qwt_compat is intended for a first start only.

    As far as I understood your application I strongly recommend to throw the code away instead of trying a port. In the end all what will be left is to overload QwtColumnSymbol::drawColumn or QwtPlotHistogram::drawColumn and to assign your values and brushes.

    Check the tvplot example how to use QwtPlotHistogram.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    WSQtProgrammer (28th June 2012)

  4. #3
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qwt 5.2.1 to 6.0.1

    Thank you very much for your reply!

    Our implementation is indeed made to draw columns with gradients.
    I will consider starting from scratch, as the way you explained it made a lot of sense.

    Again, thanks for your reply. I appreciate a lot that you took time to explain this to me. It will save me a lot of head scratching.

    Have a great day,

    WSQt

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.