I have a QVector, "wellData", of QPoints that I render on a subclassed QWidget like so:
Qt Code:
{ // QVector<QPoint> wellData; painter.drawPolyline(wellData.data(), wellData.size()); }To copy to clipboard, switch view to plain text mode
This works as expected. Suppose, however, that I have 7 QPoints with values like so:
0 1
2 2
1 3
3 -9
7 5
6 6
2 3
These are X and Y values, *except* -9 is actually a NULL data value, and this particular x,y coordinate pair should be thrown out... So instead of one longish line of 7 points, I would want 2 shorter lines of 3 points each. How to do this?
One obvious fix: use QVector's members to find -9, then split it into 2 QVectors, and draw both of these. BUT: the actual problem involves a very long Polyline consisting of thousands of QPoints with many NULL values scattered throughout... so doing this would be very cumbersome. Are there other options here?
Bookmarks