我试图在视频播放器(QVideoWidget)之上覆盖一些图形(QtGraphicsView)。我已经尝试将 QtGraphicsView 子类样式表设置为透明和背景画笔,但都没有工作。
#self.setBackgroundBrush(QtGui.QBrush(QtGui.QColor(30, 30, 30, 3)))
#self.setStyleSheet("background-color:rgba(0,0,0,0)")
#self.setStyleSheet("background:rgba(0,0,0,0)")
self.setStyleSheet("background:transparent")
self.setStyleSheet("background-color:transparent")
self.setStyleSheet("background-color:rgba(30,30,30,3)")
self.setStyleSheet("background:rgba(30,30,30,3)")
Run Code Online (Sandbox Code Playgroud)
实际意图是轻松裁剪视频(视觉方式)。所有其他工作都是关于捕获事件、做数学等。这张图片很好地解释了情况。
. 在这一点上,我感觉肯定是我做错了,QtMultiMedia 组件中必须有一些更简单的方法来绘制它们。任何想法真的很感激。