[英]How do I use paintEvent on a QVideoWidget with transparency?
我正在研究 qt5 (C +)。 我使用 QVideoWidget 播放 rtsp 視頻 stream。 我想用 QPainter 在顯示的視頻上繪制任何簽名。 但是,我在繪畫時模糊了視頻。 例如,關於繪圖區域,我給出了 QVideoWidget 圖像的一半。
嘗試在 QVideoWidget 上添加額外的 QLabel:
QLabel * label = new QLabel (ui-> videoWidget);
然后在“標簽”上繪制,還覆蓋了QVideoWidget。
我還補充說:
ui-> videoWidget-> setAttribute (Qt :: WA_X11OpenGLOverlay);
但隨后透明度一直延伸到操作系統的桌面。
嘗試設置要繪制的項目的透明度,而不是 QVideoWidget 的透明度。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.