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. Creating GUI for application working with VLC
Forum Update on Monday, May 27th 2025

Creating GUI for application working with VLC

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 4.1k 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.
  • H Offline
    H Offline
    HellFighter
    wrote on 29 May 2014, 12:58 last edited by
    #1

    Sorry for my bad english
    Hi,
    I'm very new to QT. I'm writing an application which using VLC library to play some video content.
    It is quite easy to view video via VLC on QWidget and it's subclasses but I want to make some animated transparent control panel placed over the video. When I placing another QWidget over the video it starts to blink and I also can't find a way to make it transparent.
    So I tried to use QGLWidget. Blink gone but I still can't make it transparent.
    After few days of going around with standard QT's application GUI I found out that I can write it's GUI on QT Quick. I were trying it about 3 days. When creating QTQuick Application I can't find out how to translate vido to some surface from C++ code. When creating QTQuick UI (semi-transparent rectangle) and placing it on QWidget it seems not to be transparent any more.

    Can anyone help me? Where I should implement my GUI and video output surface and how it could be done to achieve my goals?
    Later I can post some source code if anyone need it but I dont think that it would be usefull
    My OS: Windows 8.1, QT Version: 5.3, VLC version: 2.1.3, I'm using QT Creator

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vezprog
      wrote on 29 May 2014, 20:51 last edited by
      #2

      I don't know much about QGLWidget, but since it inherits QWidget, you could use QGraphicsEffects. I like to use it when making an overlay widget as black transparent backdrop behind a dialog to make them standout in front of the application.

      Create a "QGraphicsOpacityEffect":http://qt-project.org/doc/qt-5/qgraphicsopacityeffect.html and set the graphics effect on the QWidget class.

      @
      QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect(this);
      setGraphicsEffect(opacityEffect);
      opacityEffect->setOpacity(.5); // value from 0 to 1.0
      @

      You can probably stick with QGLWidget.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        HellFighter
        wrote on 29 May 2014, 22:42 last edited by
        #3

        dvez43,
        Not helped me yet :(
        I'll attach my test project here.
        "Test Project":http://yadi.sk/d/YZJgCKr9Reo4A

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vezprog
          wrote on 30 May 2014, 00:36 last edited by
          #4

          I apologize, I misunderstood your question. You don't want opacity since it will make the whole window translucent. If you want to overlay a transparent widget over another widget, you can set some window flags and widget attributes on the 'transparent widget' to make the background translucent.

          Try this:
          @
          widget->setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint);
          widget->setAttribute(Qt::WA_TranslucentBackground);
          @

          Make sure the widget is up in front as well in front of the VLC widget, you can call show() and raise() on the widget to bring it forward.

          Also, who is the parent of the widget your trying to overlay?

          1 Reply Last reply
          0
          • H Offline
            H Offline
            HellFighter
            wrote on 30 May 2014, 09:01 last edited by
            #5

            Thank you, I'll try this later today.
            But it seems to me that Qt::X11BypassWindowManagerHint will work only on systems with X11 (UNIX?) and will do nothing in Windows, am I not right?

            And about parent of the widget: I've tried 2 ways.
            First - main window as a parent. In this case nothing shown over the video.
            Second - Q[GL]Widget as a parent. In this case overlaying widget shows above the video layer but i can't make it transparent and when it moves by animation ugly artifacts on video appears.

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vezprog
              wrote on 30 May 2014, 11:52 last edited by
              #6

              If your parent is the main window, you do not need to set the window options to frame-less since it will be embedded right into it.

              set the attribute and call show() and raise() to bring it forward and you should be all set.

              1 Reply Last reply
              0
              • H Offline
                H Offline
                HellFighter
                wrote on 30 May 2014, 12:27 last edited by
                #7

                I've tried everything you wrote above but nothing helped yet.
                I can suggest two things: I'm doing something not right or the problem is in the method VLC translates video to QWidget.
                Can you try to run my test project attached earlier (if you have QT 5.3 installed)?

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andreyc
                  wrote on 30 May 2014, 14:53 last edited by
                  #8

                  "Here":http://va-sorokin.blogspot.com/2012/05/qwebview-over-phonon-videowidget.html is an example on how to add transparrent widget on top of video widget. Maybe it will help.

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    HellFighter
                    wrote on 30 May 2014, 15:07 last edited by
                    #9

                    andreyc, thank you.
                    I thought about this solution (to create a window without frame with a transparent background and synchronize its actions with those of the main window), but gave it up because decided that it was too ugly. Probably it is necessary do so. I'll try and write if I reached my goals.

                    1 Reply Last reply
                    0

                    1/9

                    29 May 2014, 12:58

                    • Login

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