New Features
examples/2D/ticks_inside: all axes start with inward ticksXBottom,XTop,YLeftandYRightare set toQwtPlot::TickInsidewhen the example opens, so the window - and the documentation screenshot regenerated from it - shows the feature right away instead of the library defaultTickOutside. The four checkboxes start checked; unchecking one, or pressingAll Outside, still switches it back for comparisondocs/assets/screenshots/ticks_inside.pngregenerated from the new default
- Two drag preview modes for the retained grid of
QwtFigureQwtFigureGridSplitter::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.Liveapplies 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::NoPenhides 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/figureGridgained 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 staticfigure-grid.pngscreenshot- Regression tests:
tests/figure_grid_splitter_testcovers 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_insidebuilds with Qt 5QDoubleSpinBox::valueChangedis overloaded in Qt 5 (doubleandQString), 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 usesQOverload<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 defaultBoundaryLinepreview does not touch the member geometry during the drag at all, and theLivepreview keeps the members painting and replots them on every move. The behavior is covered bytestMemberRepaintsStayEnabledWhileDragging() - The old in-between behavior (layout changes without repaints) is gone, so
sizesChanged()is only continuous inLivemode; hosts that need a live preview must selectQwtFigureGridSplitter::Live, the default boundary preview emits it once on release
- The splitter suspended the repaints of every grid member (
Documentation
- The retained grid section of the
QwtFigureuse guide (EN/ZH) describes the two drag preview modes, the boundary line pen and thefindChild<>()snippet to switch the mode; thefigureGriddocumentation now uses the staticfigure-grid.pngand afigure-grid-drag.gifrecording 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
figureGridtile (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
- The English and the Chinese README open with a brand banner (
中文说明(点击展开)
新功能
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()
- Qt 5 的
- 拖动保留式网格的分隔条不再产生重影
- 分隔条在每次鼠标移动重排轨道的同时,用
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)调用
- 中英文 README 开头改为品牌横幅(