New Features
- Render smoothing for curve drawing
QwtPlotCurvegains theSmoothAlgorithmenum (NoSmoothing,GaussianSmoothing,SavitzkyGolaySmoothing) withsetSmoothAlgorithm(),setSmoothWindow(),setSmoothPolynomialOrder()andsetSmoothPreserveThreshold()- Both algorithms are low pass filters operating on the polyline after downsampling and coordinate translation — only the y coordinates are modified, so the horizontal position of every feature stays exact
- A non-linear feature preservation step ( enabled by default ) keeps significant peaks and dips at their original position and height: the pixel noise band collapses to a clean line while the data is not distorted
- Implemented for
QwtPlotCurve::Lines( including filled curves ), combinable with theFittedattribute - New example
examples/2D/curvesmoothing: a 100,000 sample spectrum with random jitter — left plot default rendering vs. right plot smoothed, with runtime controls for algorithm / window / SG order / preservation threshold and replot benchmarks - New usage guide "Curve Render Smoothing" ( EN/CN, with screenshots )
Bug Fixes
- Fixed axis backbones being misplaced or missing on the first paint of a plot — the two reported symptoms were a short segment missing at the left of the x axis (x/y backbones not intersecting at the corner, healing only after an axis parameter refresh) and a whole backbone invisible until the next plot update. Root cause: the layout placed the scale widgets using the border distance stored by the previous pass, while the backbone was drawn using the freshly computed one; the corrective relayout is driven by an asynchronous
LayoutRequestthat is regularly missing or late during the initial show sequence. The fix makes placement and drawing use the same border distance in a single pass and guarantees a layout pass before the first paint:QwtPlotLayoutEngineLayoutData::ScaleData::init()now usesqMax(getBorderDistHint(), borderDist)— the exact valueQwtScaleWidget::layoutScale()draws with — instead of the stale stored border distance, closing the one-pass lag at its sourceQwtPlot::doLayout()refreshes the axis border distances even when the scale rect did not change (tick label content, formats or fonts can alter the hint without changing the geometry)QwtPlot::event()runsupdateLayout()after thePolishRequestreplot, so the first paint always uses a layout calculated from the final fonts and scale divisions (one extra pass on first show only, no steady-state cost)QwtScaleWidget::changeEvent()handlesFontChange/ApplicationFontChangeand relayouts onLocaleChange: font changes no longer leave extent and border distances stale without a repaintQwtScaleWidget::setMinBorderDist()recalculates the scale geometry like all other geometry setters (relevant forQwtPlot::alignAxisBorderDist()andQwtFigure::alignAxes())
- Fixed
QwtScaleDraw::setLength()unconditionally clamping to a positive minimum of 10, which silently turned negative lengths (legitimately used byQwtPolarGridfor left/top axes) into +10 and broke polar grid rendering; the upstream clamping semantics are restored (small magnitudes clamped to ±10, larger negative values preserved) - Fixed
QwtSplineCurveFitter::fitCurve()discarding the fitted result: the return value ofsubPaths.first()was dropped and an empty polygon was returned, so curves usingFittedtogether with fill could not be drawn at all; upstream behavior is restored (a single subpath returns that subpath's polygon)