New Features
examples/2D/downsample_demo: per-paint render time and a 1.2M sample data set- The GUI times every canvas paint (
TimedPlotCanvas::paintEvent) and showsdraw <ms> | <pts>in the toolbar, so the cost of every dataset / algorithm / view / paint-switch combination is visible right after switching; timingreplot()itself is not reliable because Qt 6 does not necessarily deliverQWidget::repaint()synchronously. The batch mode reports the render time per image as well - A third data set with about 1.23 million samples ( one order of magnitude above "many" ) makes the reduction algorithms measurable on data that is too large to be painted without reduction
- The mapped-point overlay uses the same antialiasing-aware alignment rule as
QwtPlotCurve::drawLines(), so the dots match the painted curve after the alignment policy change
- The GUI times every canvas paint (
examples/2D/ticks_inside: backbone pen width control- A
QDoubleSpinBox( 0.5 .. 3.0, in device pixels ) in a new "Backbone Pen Width" group appliesQwtAbstractScaleDraw::setPenWidthF()to all four axes, so the device pixel pen contract and the corner closure can be exercised interactively at any display scaling
- A
Bug Fixes
- Fixed antialiased curves being snapped to the device pixel grid:
drawLines()anddrawDots()enabledRoundPointswhenever the painter used a raster engine, regardless ofQPainter::Antialiasing, and snapping the mapped vertices before an antialiasing rasterizer destroys the sub-pixel geometry it needs - dense antialiased curves rendered as a visible staircase on shallow flanks. The flags are now tied to!QPainter::Antialiasingon top ofQwtPainter::roundingAlignment(painter), so non-antialiased raster, PDF/SVG and transformed painters keep their previous behavior;legendIcon()snaps only when the icon is recorded without antialiasing, andWeedOutIntermediatePointsno longer requiresRoundPoints(the quad weeding path rounds to device pixels internally), soFilterPointsAggressivestays reachable under antialiasing. The measured effect is documented in section 7 of the pixel snapping tech report - Fixed the scale pen width being multiplied by the device pixel ratio: at 200 % scaling
setPenWidthF(1.0)painted backbone and ticks 2 device pixels wide, contradicting the hairline promise of the pixel aligned scale rendering and making the same setting look different on 150 % and 200 % screens. The width is rounded to whole device pixels without the device pixel ratio now, so 1.0 (and 0.0) always paints a single device pixel line at any scaling; tick lengths keep translating from logical to device pixels - Fixed the axis corner square not closing on HiDPI displays: the near (canvas side) edge of a left/top backbone band took the first device pixel of the logical pixel of the scale position, leaving the band
dpr - 1device pixels away from the canvas edge it frames, and the corner miter extended the backbone by a hardcoded one pixel beyond the end of the scale - a guess that only matched the perpendicular backbone when border distances, pen widths and device pixel ratio happened to line up, leaving a( pw - 1 ) x ( pw - 1 )device pixel notch at the outer corner for pen widths above one. The near edge of a band growing away from the canvas is the last device pixel of its logical pixel now, andQwtScaleWidget::draw()computes the actual device positions of the perpendicular backbone bands (QwtScaleDraw::setCornerTargets()) so the miter reaches the far edge of the band adjacent to the canvas instead of a guess, while border ticks keep snapping to its near edge - also ending the backbone exactly at the band instead of clamping it against the scale span, which at device pixel ratios above one left the first device pixel of the span sticking out beyond the band as a one pixel stub at the left corners. A snapped border tick aligns its thickness into the span of the band it sits on, so even pen widths no longer leave it off the band by a device pixel; bands stacked farther out by parasite axes are not crossed, so a backbone never runs through the whole axis stack - Fixed the inside ticks (
QwtPlot::TickInside) ignoring the device pixel rules of the backbone and the outside ticks: they were stroked as a QPen ofpenWidthF()logical pixels, so at a device pixel ratio of 2 a pen width of 2 painted 4 device pixels against the 2 of the backbone, and at a ratio of 1 a fractional width like 1.5 rasterized to 1 or 2 pixels depending on the subpixel position of each tick. The newQwtScaleDraw::drawTicksInside()paints them as device pixel aligned rectangles,qMax( 1, round( penWidthF ) )device pixels thick at any ratio, starting at the canvas edge that faces the backbone band; the pen width of the selected state moved intoQwtAbstractScaleDraw::effectivePenWidthF(), so inside ticks, outside ticks and the backbone share it - Fixed the backbone miter being clipped at the canvas corners: the axis widget ended flush with the scale whenever the border distance did not reach far enough - most visibly when the outermost major ticks sit clear of the scale borders and the natural border distance hint collapses to 0 - so the miter fell outside of the widget rectangle and paintEvent clipped it, leaving a gap of one logical pixel between the perpendicular backbones at any device pixel ratio.
QwtPlot::doLayout()grows each visible axis widget toward its shared corners by the gap between the widget border and the perpendicular backbone band ( newqwt_scale_corner.h/.cpphelpers ), resolves the corners across the whole family of plots sharing the canvas ( parasite axes included ), and absorbs the extension into the border distances used bylayoutScale(), so position and length of the scales and the alignment between canvas and scales stay exactly as before;QwtPlotRenderersets the same state from its own layout instead of relying on widget geometries, so exports are deterministic and match the screen. The reserved pixels are excluded from the geometry derived from the contents rectangle ( newscaleContentsRect()), so color bars, inside titles andscaleRect()keep the extent of the scale instead of growing with the reservation - Fixed a one-pass layout lag of the axis border distances:
activate()read the stored border distances, but the hints only settle once the geometries are applied, so the first layout of a fresh plot ran with the scale maps of the default widget sizes and the next activation corrected the distances without reapplying the rectangles - the widgets kept the transitional size and the scale span drifted off the canvas.doLayout()re-runs the activation and the axis geometry pass while the border distances still change ( bounded to three passes ); since the corner reservation grows the axis widgets, hidden plots - which Qt does not relayout through deferred resize events - now also get an explicitlayoutScale(), so a plot grabbed before it was ever shown converges instead of keeping transitional geometry - Fixed
QwtPlot::replot()leaving the axis widgets with stale scale draws: replot only repainted the canvas, and the axis widgets repainted as a side effect of layout changes only, so runtime changes of a scale draw that do not move the layout -QwtAbstractScaleDraw::setPenWidthF()above all - stayed invisible until the next layout driven repaint ( measured on a real 200 % display: a new pen width appeared only after an unrelated checkbox toggled the tick direction ). replot() now schedules a repaint of every visible axis widget. Found while verifying the corner fix on screen with the new pen width option ofexamples/2D/ticks_inside - Regression tests:
tests/axis_corner_testreworked around a per-widget compose fixture that clips every widget like the screen does - the ticks-inside-border configuration of the HiDPI issue report ( border distance hints collapsed to 0 ), the device pixel contract ofsetPenWidthF(), a 72-case matrix overalignCanvasToScales, canvas margin, canvas frame width and fixed canvas sizes, renderer export determinism ( screen painting between two exports must not change a byte ), the parasite plot corner, and full corner squares at pen widths 1/2/3 and device pixel ratios 1 and 2. CTest runs the suite once per ratio (QT_SCALE_FACTOR1.0 and 2.0 ); the QSKIPs for ratios other than 1 are gone
Build
- Fixed
ctest --test-dir buildfinding no tests: only the test subdirectories calledenable_testing(), which generatesCTestTestfile.cmakefiles unreachable from the build root, so the CI test step silently ran nothing.enable_testing()is called before adding the tests directory now - Fixed the Gitee release sync workflow: the release creation passes
target_commitish, and the branch push uses the fetched remote-tracking refs, so both a release event ( detached HEAD, no local branches ) and a manualworkflow_dispatchrun syncmaster/devand attach the amalgamation - The amalgamation templates gained the new
qwt_scale_corner.h/.cpp, andsrc-amalgamate/QwtPlot.{h,cpp}were regenerated; compile-verified as a single translation unit with/bigobj
Documentation
- Pixel snapping tech report, section 7 (
docs/tech-report/point-mapper-rounding.md, EN/CN ): explains why the Qwt 6.2 baseline snapped (roundingAlignmentdefaults to true,isAligning()checks only the paint engine and transforms, neverQPainter::Antialiasing, sodrawLines()enabledRoundPointsfor an antialiased canvas ) and documents the QWT 7 fix: the 7.x reduction family keeps sub-pixel coordinates and the post-v7.5.1 policy snaps only for non-antialiased painters indrawLines()/drawDots()/legendIcon(), withWeedOutIntermediatePointsdecoupled. Measured effect: the dense shoulder blend ratio goes from 0.284 to 0.5470 ( matching--noround), sparse data stays at 0.568, and the aggressive path still collapses 199,751 vertices to 7,384 - README (EN/CN) synced and the 3D module documented: renamed the Qwt 7.0 headings, fixed the CMake/qmake wording, added the live 3D waterfall screenshot, expanded the 3D section ( Plot + Item architecture, built-in items, a minimal surface example, the sliding-window waterfall API, interaction/export and
QwtFigureintegration ), refreshed the 3D gallery ( qwtplot3d, bar3D, line3D, waterfall3D, figureSurface3D ), normalized the table headers, pointed the documentation links at the current page layout, updated the example paths toexamples/2D/examples/3D, and updated the downsampling list to the six current filters plusBreakAtNan - Documentation style pass: landing pages and introductions rewritten in plain technical prose; use guides ( 2D, 3D, general, getting started, EN/CN ) converted from checkmark/bold feature templates to plain bullets or prose, with promotional wording removed and panner class names corrected; the developer and build guides lost their document-definition introductions and checkmark lists; tech report abstracts tightened without touching derivations, code, tables, figures or benchmark numbers; the style guide itself now discourages AI-style prose ( direct subjects, no meta introductions, no promotional adjectives, no bold spam, no emoji, fewer em dashes, no restating summaries )