Results 1 to 3 of 3

Thread: QwtSyntheticPointData boundaries can't be reached

  1. #1
    Join Date
    Aug 2015
    Location
    Prague
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy QwtSyntheticPointData boundaries can't be reached

    Hello. I make use of QwtSyntheticPointData and I need to draw the plot reaching the borders of the interval. No matter how many sample points I insert, I can only get closer but can't reach it. For example:

    CosinusData():QwtSyntheticPointData(30,QwtInterval (2.0,4.0,QwtInterval::IncludeBorders))

    30 is the number of sample points. If there is 2 instead of 30, I can see the line starting at 2.0 and ending at 3.0. But I need it in 4.0. What can I do? I don't need to get closer adding more points. I only need to include max value boundary.

    Thank you! I spent the whole day over this issue and I'm stuck :Confused

  2. #2
    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: QwtSyntheticPointData boundaries can't be reached

    Quote Originally Posted by Tomas_Zajic View Post
    I spent the whole day over this issue and I'm stuck :Confused
    Qwt is open source and looking at the code makes a lot of sense, when facing such a situation.

    F.e. when checking QwtSyntheticPointData::x() you can see easily, that the step size is calculated wrong. Instead
    of "interval.width() / d_size" it has to be "interval.width() / ( d_size - 1 )".

    Fixed in all relevant branches ( including 6.1 ) - if you don't want or can't use Qwt from SVN you can simple overload your x() method:

    Qt Code:
    1. virtual CosinusData::x( uint index )
    2. {
    3. const double dx = interval().width() / ( size() - 1 );
    4. return interval.minValue() + index * dx;
    5. }
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    Tomas_Zajic (15th December 2015)

  4. #3
    Join Date
    Aug 2015
    Location
    Prague
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QwtSyntheticPointData boundaries can't be reached

    Vielen Dank! Es läuft schon
    Looking at the source code for the next time.

Similar Threads

  1. Replies: 5
    Last Post: 7th September 2011, 00:19
  2. qobject_cast fails across dynamic library boundaries
    By JPNaude in forum Qt Programming
    Replies: 9
    Last Post: 30th December 2008, 18:36
  3. QWidgte::move(int x, int y) beyond the screen boundaries
    By momesana in forum Qt Programming
    Replies: 7
    Last Post: 20th February 2007, 11:12
  4. PostMessage() across process boundaries equivalent
    By TheKedge in forum Qt Programming
    Replies: 9
    Last Post: 27th January 2006, 01:02

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.