Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

test(ui-mig): G1.6 Qt Quick Test component smoke tests

Veyra Goal Agentada6a25c8dc5
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7bc6e79e..c15512e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -780,6 +780,18 @@ if(VEYRA_BUILD_QML_UI AND Qt6_FOUND)
target_compile_features(veyra_qml_easing_tests PRIVATE cxx_std_20)
target_compile_definitions(veyra_qml_easing_tests PRIVATE VEYRA_QML_DIR="${CMAKE_CURRENT_SOURCE_DIR}/qml")
target_link_libraries(veyra_qml_easing_tests PRIVATE Qt6::Gui Qt6::Qml Qt6::Quick)
+
+ # G1.6: component smoke tests (Qt Quick Test), tests/qml/quick/tst_*.qml.
+ find_package(Qt6 COMPONENTS QuickTest)
+ if(TARGET Qt6::QuickTest)
+ add_executable(veyra_qml_quick_tests tests/qml/QuickSmokeTests.cpp)
+ set_target_properties(veyra_qml_quick_tests PROPERTIES AUTOMOC ON)
+ target_compile_features(veyra_qml_quick_tests PRIVATE cxx_std_20)
+ target_compile_definitions(veyra_qml_quick_tests PRIVATE
+ VEYRA_QML_DIR="${CMAKE_CURRENT_SOURCE_DIR}/qml"
+ QUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests/qml/quick")
+ target_link_libraries(veyra_qml_quick_tests PRIVATE Qt6::Qml Qt6::Quick Qt6::QuickTest)
+ endif()
endif()
# Qt + D3D12 host probe (S3.0): answers whether Qt can host the native video
diff --git a/docs/UI_FULL_GOAL_PLAN_2026-09-26.md b/docs/UI_FULL_GOAL_PLAN_2026-09-26.md
index b99d0ddb..b0049639 100644
--- a/docs/UI_FULL_GOAL_PLAN_2026-09-26.md
+++ b/docs/UI_FULL_GOAL_PLAN_2026-09-26.md
@@ -10,7 +10,7 @@
| 阶段 | 状态 | 最后标签 | 备注 |
|---|---|---|---|
| G0 工具与基线 | 完成 | checkpoint/ui-mig-g0.7 | 设计参考 `design-ref/`、对比 `compare/`、动效曲线 `goal/g0.5/`、缓动测试 `veyra_qml_easing_tests`(构建目录 `build/qt-probe-20260926`)、门槛基线 `goal/g0.7/`(B 阶段性能对比用 `goal/g0.7/perf`) |
-| G1 基础(缓动/背景/字体/图标/组件动效) | 进行中 | checkpoint/ui-mig-g1.5 | G1.1–G1.5 完成(Qt 6.8.3:BezierSpline ≤10 段;CurveRenderer 不能用 fillItem;可变字体 600 须设 wght 轴;Popup 无 transform;视频子窗用 videoCover 挖区);动效探针 dock/page/switch/seg/menu/dialog;下一步 G1.6 Qt Quick Test |
+| G1 基础(缓动/背景/字体/图标/组件动效) | 完成 | checkpoint/ui-mig-g1.6 | G1.1–G1.6 完成(Qt 6.8.3:BezierSpline ≤10 段;CurveRenderer 不能用 fillItem;可变字体 600 须设 wght 轴;Popup 无 transform;视频子窗用 videoCover 挖区);动效探针 dock/page/switch/seg/menu/dialog;Quick Test 8/8;M28/M29 曲线未执行;下一步 G2 |
| G2 外壳 | 未开始 | | |
| G3 四主屏 | 未开始 | | |
| B1 小项 + 桥接补齐 | 未开始 | | |
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index fb6e638a..95731909 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -6635,3 +6635,9 @@ release. 5090 live acceptance, 15-second hitch and user flicker remain unresolve
- M29 箭头:改用 Lucide right 图标。
- M28/M29 只看了静态截图(zoom-acc.png),动效曲线未执行探针。
- 偏差:提示气泡字号 11.5px 在 QML 里只能是整数 pixelSize,暂用 11,G3 统一处理小数字号。f-aud 对话框的白色滚动条属 G3。
+- G1.6 Qt Quick Test 组件冒烟(2026-09-26,`checkpoint/ui-mig-g1.6`):
+ - 新目标 `veyra_qml_quick_tests`(`tests/qml/QuickSmokeTests.cpp` + `tests/qml/quick/tst_components.qml`),需 Qt6::QuickTest,缺失时跳过。
+ - 用例:开关切换、分段索引、滑块点击取值、滑块拖动取值(+20% 宽度≈70,释放时 moved 只发一次)、折叠高度、VMenu 选择(勾选移动、130ms 后发 index、禁用项无效)。测试中 `Theme.reduced = true`。
+ - 命令:`powershell -NoProfile -File tools/qt_probe/run-quick-tests.ps1 -Out E:\项目\Veyra\logs\ui-qml-migration-20260925\goal\g1.6-quick-tests.txt`。
+ - 结果:8 passed, 0 failed(含 init/cleanup)。首次运行 test_slider_tap 计数为 2,原因是前一个拖动用例也发 moved,已在各用例开头 clear。
+ - 脚本内 QtTest 控制台输出经管道丢失,改为 `-o <file>,txt` 再读文件。
diff --git a/tests/qml/QuickSmokeTests.cpp b/tests/qml/QuickSmokeTests.cpp
new file mode 100644
index 00000000..db05f9ef
--- /dev/null
+++ b/tests/qml/QuickSmokeTests.cpp
@@ -0,0 +1,14 @@
+// G1.6: component smoke tests through Qt Quick Test (tests/qml/quick/tst_*.qml).
+// The Veyra module loads from the source tree's qml/ as plain files, like the app.
+#include <QQmlEngine>
+#include <QtQuickTest/quicktest.h>
+
+class Setup : public QObject {
+ Q_OBJECT
+public slots:
+ void qmlEngineAvailable(QQmlEngine* engine) { engine->addImportPath(QStringLiteral(VEYRA_QML_DIR)); }
+};
+
+QUICK_TEST_MAIN_WITH_SETUP(veyra_qml_quick_tests, Setup)
+
+#include "QuickSmokeTests.moc"
diff --git a/tests/qml/quick/tst_components.qml b/tests/qml/quick/tst_components.qml
new file mode 100644
index 00000000..6b7a3631
--- /dev/null
+++ b/tests/qml/quick/tst_components.qml
@@ -0,0 +1,135 @@
+// G1.6 component smoke tests: each control is driven through real mouse events and
+// its visible state checked, so a control that draws but does nothing fails here.
+import QtQuick
+import QtTest
+import Veyra
+
+Item {
+ id: root
+ width: 800
+ height: 600
+
+ VSwitch { id: sw; x: 10; y: 10 }
+ SignalSpy { id: swSpy; target: sw; signalName: "toggled" }
+
+ VSeg {
+ id: seg
+ x: 10; y: 50
+ options: [{ id: "a", label: "2K" }, { id: "b", label: "4K" }, { id: "c", label: "8K" }]
+ current: "a"
+ onPicked: id => current = id
+ }
+
+ VSlider { id: slider; x: 10; y: 100; width: 200; from: 0; to: 100; value: 50 }
+ SignalSpy { id: sliderSpy; target: slider; signalName: "moved" }
+
+ VAccordion {
+ id: acc
+ x: 300; y: 10; width: 320
+ title: "超分辨率"
+ summary: "测试"
+ glyph: "sparkles"
+ enabledSwitch: false
+ Rectangle { implicitWidth: 100; implicitHeight: 120; color: "red" }
+ }
+
+ Item { id: anchorItem; x: 300; y: 400; width: 120; height: 30 }
+ VMenu {
+ id: menu
+ title: "测试"
+ items: [{ label: "甲", checked: true }, { sep: true }, { label: "乙" }, { label: "丙", disabled: true }]
+ }
+ SignalSpy { id: menuSpy; target: menu; signalName: "picked" }
+
+ TestCase {
+ name: "Components"
+ when: windowShown
+
+ function initTestCase() { Theme.reduced = true } // no waiting on transitions
+
+ function test_switch() {
+ compare(sw.checked, false)
+ mouseClick(sw)
+ compare(sw.checked, true)
+ compare(swSpy.count, 1)
+ compare(swSpy.signalArguments[0][0], true)
+ mouseClick(sw)
+ compare(sw.checked, false)
+ }
+
+ function test_seg() {
+ compare(seg.currentIndex, 0)
+ // Click the third label; the indicator follows it.
+ const third = seg.currentItem.parent.children[2]
+ mouseClick(third)
+ compare(seg.current, "c")
+ compare(seg.currentIndex, 2)
+ tryCompare(seg, "indicatorX", seg.targetX)
+ }
+
+ function test_slider_tap() {
+ sliderSpy.clear()
+ mouseClick(slider, 150, slider.height / 2)
+ fuzzyCompare(slider.value, 75, 1)
+ compare(sliderSpy.count, 1)
+ }
+
+ function test_slider_drag() {
+ // Drag from the knob 40 px right: the value moves by 40/200 of the range,
+ // not by a running total (the G1.5 drag fix).
+ slider.value = 50
+ sliderSpy.clear()
+ const y = slider.height / 2
+ mousePress(slider, 100, y)
+ for (let i = 1; i <= 8; ++i) mouseMove(slider, 100 + i * 5, y)
+ mouseRelease(slider, 140, y)
+ fuzzyCompare(slider.value, 70, 2)
+ compare(sliderSpy.count, 1)
+ }
+
+ function test_accordion() {
+ compare(acc.open, false)
+ compare(acc.implicitHeight, acc.headerHeight)
+ mouseClick(acc, 40, acc.headerHeight / 2)
+ compare(acc.open, true)
+ verify(acc.implicitHeight >= acc.headerHeight + 120)
+ mouseClick(acc, 40, acc.headerHeight / 2)
+ compare(acc.open, false)
+ }
+
+ function test_menu() {
+ menu.openAt(anchorItem, "up")
+ tryCompare(menu, "opened", true)
+ // Opens above the anchor, from its centre.
+ verify(menu.y + menu.height <= anchorItem.y)
+ compare(menu.checks[0], true)
+ // Pick 乙 (index 2): the tick moves at once, the signal comes 130 ms later.
+ const rows = findRows(menu.contentItem)
+ compare(rows.length, 3)
+ mouseClick(rows[1])
+ compare(menu.checks[2], true)
+ compare(menu.checks[0], false)
+ tryCompare(menuSpy, "count", 1)
+ compare(menuSpy.signalArguments[0][0], 2)
+ tryCompare(menu, "visible", false)
+ // A disabled row does nothing.
+ menu.openAt(anchorItem, "up")
+ tryCompare(menu, "opened", true)
+ mouseClick(findRows(menu.contentItem)[2])
+ wait(200)
+ compare(menuSpy.count, 1)
+ menu.close()
+ }
+
+ // The option rows: Rectangles with radius 9 inside the menu's list.
+ function findRows(item) {
+ let out = []
+ for (let i = 0; i < item.children.length; ++i) {
+ const c = item.children[i]
+ if (c.radius === 9 && c.implicitHeight > 20) out.push(c)
+ out = out.concat(findRows(c))
+ }
+ return out
+ }
+ }
+}
diff --git a/tools/qt_probe/run-quick-tests.ps1 b/tools/qt_probe/run-quick-tests.ps1
new file mode 100644
index 00000000..a60ebae9
--- /dev/null
+++ b/tools/qt_probe/run-quick-tests.ps1
@@ -0,0 +1,16 @@
+# Runs veyra_qml_quick_tests (G1.6) with the Qt runtime on PATH for this process only.
+param([string]$Build = 'E:\项目\Veyra\build\qt-probe-20260926',
+ [string]$Qt = 'E:\项目\Veyra\deps\qt\6.8.3\msvc2022_64',
+ [string]$Out = '')
+$env:PATH = "$Qt\bin;$env:PATH"
+$env:QT_PLUGIN_PATH = "$Qt\plugins"
+$env:TEMP = 'E:\项目\Veyra\tmp\ui-qml-migration-20260925'; $env:TMP = $env:TEMP
+# QtTest's console output does not survive the pipe here; results go through -o.
+$res = Join-Path $env:TEMP 'quick-tests.txt'
+& (Join-Path $Build 'veyra_qml_quick_tests.exe') -o "$res,txt" | Out-Null
+$code = $LASTEXITCODE
+$text = Get-Content -LiteralPath $res -Raw -Encoding utf8
+$text.TrimEnd()
+if ($Out) { $text | Set-Content -LiteralPath $Out -Encoding utf8 }
+"exit=$code"
+exit $code