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. Enable transparency for widget over widget rendered externally
QtWS25 Last Chance

Enable transparency for widget over widget rendered externally

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by
    #1

    Following the example given in another thread I've ended up with this short code:

        WId winid = ui->widget->winId();
        
        QString program;
        program = "C:\\Downloads\\mplayer-svn-38008\\mplayer.exe";
    
        QStringList arguments;
        arguments << "-wid" << QString::number(winid) << "F:\\test.wmv";
    
        QProcess *m_process = new QProcess(this);
        m_process->start(program, arguments);
    

    It renders the output of mplayer into my "widget". The problem is I need to put over this one other widgets with alpha channel. Doing this in the usual way (i.e. settings a stylesheet with a rgba background color) doesn't work - I'm afraid because the external program draw in the WinId on top of Qt does with its own widgets. The result is any widget is "hidden".

    Is there a way to enable such a transparency?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Since you are rendering a Windows media video, why not use Qt Multimedia ?

      Or if you need a multimedia Swiss army knife, you can take a look at the VLC-Qt project.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mark81
        wrote on last edited by
        #3

        That won't work because I need to decode a live video stream (TS) with the lowest latency as possible. I found only mplayer is able to do this.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Mark81 said in Enable transparency for widget over widget rendered externally:

          -wid

          Docs says ". This option fills the given window completely"
          so it seems doubtful it would respect any transparent settings.

          I wonder how it reacts to setWindowOpacity()

          M 1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Following this configuration example it seems to be possible also with VLC.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            M 1 Reply Last reply
            1
            • mrjjM mrjj

              @Mark81 said in Enable transparency for widget over widget rendered externally:

              -wid

              Docs says ". This option fills the given window completely"
              so it seems doubtful it would respect any transparent settings.

              I wonder how it reacts to setWindowOpacity()

              M Offline
              M Offline
              Mark81
              wrote on last edited by Mark81
              #6

              @mrjj said in Enable transparency for widget over widget rendered externally:

              Docs says ". This option fills the given window completely"
              so it seems doubtful it would respect any transparent settings.

              Well, for me is ok if it fills the given window completely. The problem is related to the Qt Widgets that are not drawn above it.
              I mean, I'm not interested into the transparency of the video, instead I need the Widgets on top of it respect transparency settings.

              1 Reply Last reply
              0
              • SGaistS SGaist

                Following this configuration example it seems to be possible also with VLC.

                M Offline
                M Offline
                Mark81
                wrote on last edited by
                #7

                @SGaist said in Enable transparency for widget over widget rendered externally:

                Following this configuration example it seems to be possible also with VLC.

                I've tried with VLC but its latency is much higher than mplayer.

                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