Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to add a transparent QLabel on top of a video?
Forum Updated to NodeBB v4.3 + New Features

How to add a transparent QLabel on top of a video?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • cocoC Offline
    cocoC Offline
    coco
    wrote on last edited by
    #1

    Hello,
    I would like to add a transparent QLabel on top of a video displaying a text. I have tried with the code below but it doesn't work.

    myLabel->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
    myLabel->setAttribute(Qt::WA_TranslucentBackground);
    

    I have also tried with setStyleSheet to set transparent background. The label does show on top of the video but the background is not transparent (grey border is visible).

    Are there any ways that I get around with this? Thank you.

    cocoC 1 Reply Last reply
    0
    • cocoC coco

      Hello,
      I would like to add a transparent QLabel on top of a video displaying a text. I have tried with the code below but it doesn't work.

      myLabel->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
      myLabel->setAttribute(Qt::WA_TranslucentBackground);
      

      I have also tried with setStyleSheet to set transparent background. The label does show on top of the video but the background is not transparent (grey border is visible).

      Are there any ways that I get around with this? Thank you.

      cocoC Offline
      cocoC Offline
      coco
      wrote on last edited by
      #2

      So after digging around, I found that I should use QGraphicsView along with QGraphicsScene and QGraphicsVideoItem instead of QVideoWidget to display the video.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved