github czyt1988/QWT v7.6.1
QwtPlot v7.6.1

3 days ago

New Features

  • examples/2D/ticks_inside: all axes start with inward ticks
    • XBottom, XTop, YLeft and YRight are set to QwtPlot::TickInside when the example opens, so the window - and the documentation screenshot regenerated from it - shows the feature right away instead of the library default TickOutside. The four checkboxes start checked; unchecking one, or pressing All Outside, still switches it back for comparison
    • docs/assets/screenshots/ticks_inside.png regenerated from the new default
  • Two drag preview modes for the retained grid of QwtFigure
    • QwtFigureGridSplitter::setDragPreviewMode() selects how the members follow a divider while it is dragged. BoundaryLine (the default) only moves a virtual boundary line while the mouse is down and applies the new track ratios once, on release: the members are neither relaid out nor repainted during the drag and a whole drag costs a single layout pass. Live applies the ratios on every mouse move, runs the synchronous layout pass and replots the members, so the plots really follow the divider at the cost of a layout and replot per move. dragPreviewMode() reports the mode; changing it cancels a running drag
    • The line of the default mode is a thin strip above the members (setBoundaryLinePen() / boundaryLinePen(), a two pixel dashed blue line by default) that follows the clamped divider position, spans the whole figure and stays aligned when the figure is resized mid-drag. Qt::NoPen hides the line and keeps the commit-on-release behaviour
    • The boundary line overlay is created on the first boundary drag and destroyed when the drag ends, so a figure without a running drag has no extra child widget; its object name (QwtFigureGridBoundaryLine) is stable for tests and host introspection
    • examples/2D/figureGrid gained a "Drag preview" selector in the dock, and the use guide (EN/ZH) demonstrates the drag with a new screen recording (figure-grid-drag.gif) next to the static figure-grid.png screenshot
    • Regression tests: tests/figure_grid_splitter_test covers the boundary preview (ratios untouched until release, line geometry/clamping, figure resize while dragging, Esc, pen), the adapted live preview and the fact that neither mode suspends the member repaints

Bug Fixes

  • examples/2D/ticks_inside builds with Qt 5
    • QDoubleSpinBox::valueChanged is overloaded in Qt 5 (double and QString), so the unqualified pointer-to-member connection of the backbone pen width control did not compile with the Qt 5 versions the project supports. The connection now uses QOverload<double>::of()
  • Dragging a divider of the retained grid no longer leaves ghosting artifacts
    • The splitter suspended the repaints of every grid member (setUpdatesEnabled(false)) while it resized the tracks on every mouse move. Qt then kept showing stale pixels of the moved members - the ghosting and tearing of heavy members such as a spectrogram. The repaint suspension is gone: the default BoundaryLine preview does not touch the member geometry during the drag at all, and the Live preview keeps the members painting and replots them on every move. The behavior is covered by testMemberRepaintsStayEnabledWhileDragging()
    • The old in-between behavior (layout changes without repaints) is gone, so sizesChanged() is only continuous in Live mode; hosts that need a live preview must select QwtFigureGridSplitter::Live, the default boundary preview emits it once on release

Documentation

  • The retained grid section of the QwtFigure use guide (EN/ZH) describes the two drag preview modes, the boundary line pen and the findChild<>() snippet to switch the mode; the figureGrid documentation now uses the static figure-grid.png and a figure-grid-drag.gif recording of a real drag instead of the per-variant screenshots
  • Both READMEs were rebuilt around a hero section and a documentation map
    • The English and the Chinese README open with a brand banner (docs/assets/brand/qwt-hero-en.png, qwt-hero-zh.png), the language switch, the release / documentation build / license / stars / Qt / C++ / documentation badges, a one line claim and a navigation row (documentation, getting started, quick start, features, gallery, changelog)
    • The "Why Qwt 7?" prose was condensed into a license / rendering / strengths / limitations table of QCustomPlot, Qwt, Qt Charts and KDChart, followed by the repository, mirror and documentation links
    • A "Documentation" section maps the use guide to the English and Chinese GitHub Pages (topic table) and folds the local documentation build into a collapsible block, so the quick start, the gallery and the changelog follow it
    • The gallery gained the figureGrid tile (docs/assets/screenshots/figure-grid.png, examples/2D/figureGrid) in the advanced charts section of both files
    • The retained grid paragraph of both files names the two drag preview modes and the setDragPreviewMode(QwtFigureGridSplitter::Live) call that switches to the live preview
中文说明(点击展开)

新功能

  • examples/2D/ticks_inside:打开时所有坐标轴默认刻度朝内
    • 示例打开时把 XBottom、XTop、YLeft、YRight 设为 QwtPlot::TickInside,因此窗口以及由它重新生成的文档截图能直接展示该特性,而不是库默认的 TickOutside。四个复选框默认为勾选;取消勾选或点击 All Outside 仍可切回朝外做对比
    • 重新生成了 docs/assets/screenshots/ticks_inside.png
  • QwtFigure 保留式网格的两种拖动预览模式
    • QwtFigureGridSplitter::setDragPreviewMode() 选择拖动分隔条时成员如何跟随。BoundaryLine(默认)在鼠标按下期间只移动一条虚拟边界线,新比例在松手时一次性生效:拖动过程中成员既不重排也不重绘,整次拖动只花一次布局。Live 在每次鼠标移动时应用比例、执行同步布局并重绘,绘图真正跟随分隔条,代价是每次移动都要做一次布局和重绘。dragPreviewMode() 查询当前模式;拖动过程中切换模式会取消当前拖动
    • 默认模式的线条是成员上方的一条窄条(setBoundaryLinePen() / boundaryLinePen(),默认为两像素蓝色虚线),跟随被夹取的分隔条位置、贯穿整个 figure,并在拖动中 figure 尺寸变化时保持对齐;把画笔设为 Qt::NoPen 只会隐藏线条,松手生效的行为不变
    • 虚拟边界线覆盖层在第一次边界线拖动时创建、拖动结束时销毁,因此没有拖动中的 figure 不会多出子控件;它的对象名(QwtFigureGridBoundaryLine)固定,便于测试和宿主检查
    • examples/2D/figureGrid 的右侧面板新增「Drag preview」选择框;使用指南(中/英)在静态截图 figure-grid.png 之外,新增一段真实拖动的录屏(figure-grid-drag.gif)来演示拖动布局
    • 回归测试:tests/figure_grid_splitter_test 覆盖边界线预览(松手前比例不变、线条位置与夹取、拖动中 figure 缩放、Esc、画笔)、调整后的实时预览,以及两种模式都不会暂停成员重绘

Bug 修复

  • examples/2D/ticks_inside 重新支持 Qt 5 编译
    • Qt 5 的 QDoubleSpinBox::valueChanged 是重载信号(double 和 QString),轴线笔宽控件原先使用未消歧的成员函数指针连接,在项目支持的 Qt 5 版本下无法编译。现改用 QOverload<double>::of()
  • 拖动保留式网格的分隔条不再产生重影
    • 分隔条在每次鼠标移动重排轨道的同时,用 setUpdatesEnabled(false) 暂停了所有网格成员的重绘。Qt 因此持续显示被移动成员的旧像素——这就是频谱图等重成员出现重影和撕裂的原因。重绘暂停已移除:默认的 BoundaryLine 预览在拖动期间完全不碰成员的几何,Live 预览则让成员持续重绘并在每次移动后重绘整幅图。该行为由 testMemberRepaintsStayEnabledWhileDragging() 覆盖
    • 原先「只改布局不重绘」的中间状态不复存在,因此 sizesChanged() 只在 Live 模式下连续发出;需要实时预览的宿主应显式选择 QwtFigureGridSplitter::Live,默认的边界线预览只在松手时发出一次

文档

  • QwtFigure 使用指南的保留式网格一节(中/英)说明了两种拖动预览模式、边界线画笔以及用 findChild<>() 切换模式的代码;figureGrid 文档改为使用静态截图 figure-grid.png 加一段真实拖动录屏 figure-grid-drag.gif,不再保留逐变体截图
  • 两份 README 围绕首屏横幅与文档索引重做
    • 中英文 README 开头改为品牌横幅(docs/assets/brand/qwt-hero-en.png、qwt-hero-zh.png),加上语言切换、发布/文档构建/许可证/星标/Qt/C++/文档徽章、一句话定位,以及导航行(文档、快速开始、简介、特性、展示、更新日志)
    • 「为什么选择 Qwt 7」的大段文字压缩为 QCustomPlot、Qwt、Qt Charts、KDChart 四者的许可证/渲染方式/优点/局限对照表,其后是仓库、镜像与文档链接
    • 新增「文档」一节,用主题表格把使用指南对应到中英文 GitHub Pages,并把本地构建文档的步骤收进可折叠块,其后才是快速开始、示例展示与更新日志
    • 示例展示的「进阶图表」部分补上 figureGrid 一栏(docs/assets/screenshots/figure-grid.png,examples/2D/figureGrid),中英文一致
    • 保留式网格一节(中/英)补充说明两种拖动预览模式,以及切换到实时预览的 setDragPreviewMode(QwtFigureGridSplitter::Live) 调用

Don't miss a new QWT release

NewReleases is sending notifications on new releases.