Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the main window and basic playback controls of viewer #2739

Merged
merged 21 commits into from
Mar 25, 2025

Conversation

CodeJhF
Copy link
Collaborator

@CodeJhF CodeJhF commented Mar 20, 2025

本次PR包含如下内容:
1、实现了viewer的主窗口
2、实现了viewer的一些基础功能,包括暂停/播放、上一帧/下一帧、拖动、调整大小、拖拽pag文件等
3、将第三方库winsparkle的引入方式从拉取代码之后编译变为以vendor的形式上传至vendor目录

@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.38%. Comparing base (52f46bf) to head (9fdf756).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2739      +/-   ##
==========================================
- Coverage   77.40%   77.38%   -0.03%     
==========================================
  Files         419      419              
  Lines       22270    22270              
  Branches     6366     6366              
==========================================
- Hits        17239    17234       -5     
- Misses       3775     3779       +4     
- Partials     1256     1257       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

#include <QObject>
#include "PAGWindow.h"

class PAGWindow;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能include吗?减少使用前置声明

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个问题已修复,没有使用前向声明了


auto PAGView::getPAGWidth() const -> int {
if (pagFile == nullptr) {
return 100;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该返回一个非法值,如:-1。返回100都不确定是pagFile为nullptr,还是width真的是100,下面的height也是一样的。


auto PAGView::getBackgroundColor() const -> QColor {
if (pagFile == nullptr) {
return QColor::fromRgb(0, 0, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用QColor预置颜色常量更简洁,QColor::black()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复

setIsPlaying(false);
auto progress = this->progress - progressPerFrame;
if (progress < 0) {
progress = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是progress=0.0吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前的逻辑是progress向后调整时,如果大于1,progress就为0,即从第一帧播放;如果progress向前调整时,如果小于0,progress就为1,即从最后一帧开始播放

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是实现循环播放的逻辑,那就ok

@shlzxjp shlzxjp merged commit 719ba96 into Tencent:main Mar 25, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants