-
Notifications
You must be signed in to change notification settings - Fork 56
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
[废弃] 改进 sliderSong 的点击、拖拽与同步问题 #32
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a646490
to
d981694
Compare
1. Change slider's behavior. When the handle have been clicked, it will jump to the position of that click rather than move forward or backward a "step". 2. Use `subControlRect()' to get the region of the handle. 3. Use `mouseMoveEvent()' to test the cursor's position and change its shape.
只单击不移动 handle 将不再改变播放进度(会从手柄当前位置重新播放) 重写 QSlider::mouseReleaseEvent 以使 &QSlider::sliderReleased 的接收者由 sig_refreshClickPos 信号获得最新位置 重命名信号 &BesSlider::sig_clickNotOnHandle 为 &BesSlider::sig_refreshClickPos 重命名方法 BottomWidget::onSliderSongClickNotOnHandle 为 BottomWidget::onSliderSongClicked
抱歉,由于之前对 git 的理解有误,连续执行了几个误操作,造成了由于待合并分支上的修改被抹去而自动关闭 PR,又多次 force-push 到待合并分支的问题。 现在是最佳状态,可以 review 了。 |
辛苦了!我后面找个时间仔细看看~ |
好的。我这边有可能会继续开 issue 和 PR ,如果是 PR 我会去解决分支冲突问题。一切都等你有空再看。 |
抱歉,我这边为了把 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
要实现的
鼠标形状
Qt::PointingHandCursor
,否则不改变形状。这与 网易云音乐 的模式相同;mouseMoveEvent(QMouseEvent *)
方法中处理,而不是enterEvent(QEvent *event)
或leaveEvent(QEvent *event)
;单击 sliderSong 后的行为
BottomWidget
中很多关于 sliderSong 的冗余的逻辑。void BottomWidget::positionChanged(int position)
的调用时机问题,在m_positionUpdateTimer
周期极短时(现在为 0 ,能看得很清楚),sliderSong 在定位到新位置后会闪回原位置,具体的可以看打印的日志。这与PlayThread
和MusicPlayer
有一定关系,我还未解决这个问题(在 Windows 10 上现象出现频率降低)。还没做而且意义不大的
QSlider#sliderSound::handle:horizontal:hover
)。放弃的
这在 CSS 中直接用
box-shadow
就行,但是 QSS 不可以。如果是整个控件加阴影,可以用QGraphicsDropShadowEffect
,但我无法单独获得手柄这个控件。所以你在样式(
ISkin.h
)中写的是,当鼠标 hover 时改变中央红色区域半径,而不是仿照 网易云音乐 的模式,我这才知道原因。相关资料:
其他
环境
Windows 10 + MSVC 2015 32-bit + Qt 5.9.8
Windows 7 SP1 无开发环境
Ubuntu 18.04 ( GNOME Shell 3.28.2 )+ gcc 7.4.0 64-bit + Qt 5.9.8
有关的 issue
#8 #21