QT:如何更改进度条的颜色
我有一个视频编辑器视图和一个蓝色进度条。 但是,当我单击修剪开始时,如何将进度条颜色更改为红色,当我单击 QT 中的修剪结束按钮时,它将返回蓝色
i am having one videoeditor view and one progressbar is there with blue color .
But how i will change the progressbar color to red when i clicked trim start and it will return to blue when i will click the trim endbutton in QT
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是来自 Qt 文档
您可以设置
::chunk
部分显式更改背景颜色。This is from the Qt Documentation
You can style the
::chunk
part explicitly to change background color.编辑:我误解了这个问题。您正在谈论 Adobe Premiere 中的剪辑选择器/编辑器之类的东西。为了做这样的事情,我只需创建一个自定义小部件,然后自己处理绘图。这不会太难。您需要子类化QWidget,然后重新实现paintEvent(),然后可能还需要实现mousePressEvent()、mouseReleaseEvent() 和mouseMouseEvent()。
EDIT: I misunderstood the question. You are talking about something like the clip selector/editor in Adobe Premiere. To do something like this I would just create a custom widget, and handle the drawing yourself. It would not be too hard. You will need to subclass QWidget, then reimplement the paintEvent(), then also probably the mousePressEvent(), mouseReleaseEvent(), and mouseMouseEvent().