Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Enable transparency for widget over widget rendered externally

    General and Desktop
    3
    7
    1221
    Loading More Posts
    • 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
      Mark81 last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • M
          Mark81 last edited by

          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 Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by

            @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 Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              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 Reply Quote 1
              • M
                Mark81 @mrjj last edited by Mark81

                @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 Reply Quote 0
                • M
                  Mark81 @SGaist last edited by

                  @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 Reply Quote 0
                  • First post
                    Last post