github czyt1988/QWT v7.5.2
QwtPlot v7.5.2

latest releases: v7.6.1, v7.6.0
one month ago

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 shows draw <ms> | <pts> in the toolbar, so the cost of every dataset / algorithm / view / paint-switch combination is visible right after switching; timing replot() itself is not reliable because Qt 6 does not necessarily deliver QWidget::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
  • examples/2D/ticks_inside: backbone pen width control
    • A QDoubleSpinBox ( 0.5 .. 3.0, in device pixels ) in a new "Backbone Pen Width" group applies QwtAbstractScaleDraw::setPenWidthF() to all four axes, so the device pixel pen contract and the corner closure can be exercised interactively at any display scaling

Bug Fixes

  • Fixed antialiased curves being snapped to the device pixel grid: drawLines() and drawDots() enabled RoundPoints whenever the painter used a raster engine, regardless of QPainter::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::Antialiasing on top of QwtPainter::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, and WeedOutIntermediatePoints no longer requires RoundPoints (the quad weeding path rounds to device pixels internally), so FilterPointsAggressive stays 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 - 1 device 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, and QwtScaleWidget::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 of penWidthF() 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 new QwtScaleDraw::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 into QwtAbstractScaleDraw::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 ( new qwt_scale_corner.h/.cpp helpers ), resolves the corners across the whole family of plots sharing the canvas ( parasite axes included ), and absorbs the extension into the border distances used by layoutScale(), so position and length of the scales and the alignment between canvas and scales stay exactly as before; QwtPlotRenderer sets 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 ( new scaleContentsRect() ), so color bars, inside titles and scaleRect() 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 explicit layoutScale(), 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 of examples/2D/ticks_inside
  • Regression tests: tests/axis_corner_test reworked 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 of setPenWidthF(), a 72-case matrix over alignCanvasToScales, 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_FACTOR 1.0 and 2.0 ); the QSKIPs for ratios other than 1 are gone

Build

  • Fixed ctest --test-dir build finding no tests: only the test subdirectories called enable_testing(), which generates CTestTestfile.cmake files 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 manual workflow_dispatch run sync master/dev and attach the amalgamation
  • The amalgamation templates gained the new qwt_scale_corner.h/.cpp, and src-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 ( roundingAlignment defaults to true, isAligning() checks only the paint engine and transforms, never QPainter::Antialiasing, so drawLines() enabled RoundPoints for 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 in drawLines()/drawDots()/legendIcon(), with WeedOutIntermediatePoints decoupled. 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 QwtFigure integration ), 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 to examples/2D/examples/3D, and updated the downsampling list to the six current filters plus BreakAtNan
  • 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 )

Don't miss a new QWT release

NewReleases is sending notifications on new releases.