-
Notifications
You must be signed in to change notification settings - Fork 468
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
Conversation
… recommended by the viewer to be 6.2.0
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
viewer/src/PAGViewer.h
Outdated
#include <QObject> | ||
#include "PAGWindow.h" | ||
|
||
class PAGWindow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不能include吗?减少使用前置声明
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题已修复,没有使用前向声明了
viewer/src/rendering/PAGView.cpp
Outdated
|
||
auto PAGView::getPAGWidth() const -> int { | ||
if (pagFile == nullptr) { | ||
return 100; |
There was a problem hiding this comment.
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也是一样的。
viewer/src/rendering/PAGView.cpp
Outdated
|
||
auto PAGView::getBackgroundColor() const -> QColor { | ||
if (pagFile == nullptr) { | ||
return QColor::fromRgb(0, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用QColor预置颜色常量更简洁,QColor::black()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修复
viewer/src/rendering/PAGView.cpp
Outdated
setIsPlaying(false); | ||
auto progress = this->progress - progressPerFrame; | ||
if (progress < 0) { | ||
progress = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是progress=0.0吧
There was a problem hiding this comment.
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,即从最后一帧开始播放
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是实现循环播放的逻辑,那就ok
本次PR包含如下内容:
1、实现了viewer的主窗口
2、实现了viewer的一些基础功能,包括暂停/播放、上一帧/下一帧、拖动、调整大小、拖拽pag文件等
3、将第三方库winsparkle的引入方式从拉取代码之后编译变为以vendor的形式上传至vendor目录