Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. How to use VLC-QT widgets as Qt widgets?
Forum Update on Monday, May 27th 2025

How to use VLC-QT widgets as Qt widgets?

Scheduled Pinned Locked Moved Solved 3rd Party Software
11 Posts 2 Posters 4.4k 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.
  • A Offline
    A Offline
    abhay
    wrote on 9 Oct 2016, 10:05 last edited by
    #1

    Hello all..I am new to Qt Development.I am working with vlc-qt libraries to develop a media player.But I'm unable to load vlc-qt widgets(for example,widgetvolumeslider).Can anyone give me an example of how to create volumeslider using vlc-qt libraries.Thanks in advance!!

    ? 1 Reply Last reply 9 Oct 2016, 10:13
    0
    • A abhay
      9 Oct 2016, 10:05

      Hello all..I am new to Qt Development.I am working with vlc-qt libraries to develop a media player.But I'm unable to load vlc-qt widgets(for example,widgetvolumeslider).Can anyone give me an example of how to create volumeslider using vlc-qt libraries.Thanks in advance!!

      ? Offline
      ? Offline
      A Former User
      wrote on 9 Oct 2016, 10:13 last edited by
      #2

      @abhay Hi! Welcome to the Qt forum! There is a complete example for a simple media player (including a volume slider), see: https://github.com/vlc-qt/examples/tree/master/simple-player

      A 1 Reply Last reply 9 Oct 2016, 10:18
      2
      • ? A Former User
        9 Oct 2016, 10:13

        @abhay Hi! Welcome to the Qt forum! There is a complete example for a simple media player (including a volume slider), see: https://github.com/vlc-qt/examples/tree/master/simple-player

        A Offline
        A Offline
        abhay
        wrote on 9 Oct 2016, 10:18 last edited by
        #3

        @Wieland Thanks for your suggestion! I am using that simple-player code only for creating the media player.But I want to customize the volumeslider.Can I use the classes provided in this link : https://vlc-qt.tano.si/reference/1.1/classVlcWidgetVolumeSlider.html .If possible,can you tell me how to do that? Thanks!

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on 9 Oct 2016, 10:30 last edited by
          #4

          If you take a look at WidgetVolumeSlider.h and WidgetVolumeSlider.cpp you'll see that this volume slider is only a slightly extended QSlider. So yes, customizing it shouldn't be a big problem.

          A 1 Reply Last reply 9 Oct 2016, 11:00
          2
          • ? A Former User
            9 Oct 2016, 10:30

            If you take a look at WidgetVolumeSlider.h and WidgetVolumeSlider.cpp you'll see that this volume slider is only a slightly extended QSlider. So yes, customizing it shouldn't be a big problem.

            A Offline
            A Offline
            abhay
            wrote on 9 Oct 2016, 11:00 last edited by
            #5

            @Wieland and one more question.I am getting vertical slider.How to get a horizontalslider and I am unable to increase the volume by mouse I can only increase the volume by selecting it with mouse and press up arrow on the keyboard.How to sort out this problem.Please help me..

            ? 1 Reply Last reply 9 Oct 2016, 11:38
            0
            • A abhay
              9 Oct 2016, 11:00

              @Wieland and one more question.I am getting vertical slider.How to get a horizontalslider and I am unable to increase the volume by mouse I can only increase the volume by selecting it with mouse and press up arrow on the keyboard.How to sort out this problem.Please help me..

              ? Offline
              ? Offline
              A Former User
              wrote on 9 Oct 2016, 11:38 last edited by
              #6

              Orientation
              The orientation is controlled by the orientation propery; just set it to Qt::Horizontal.

              Mouse Issue
              The slider not correctly responding to mouse clicks is caused by the provided overrides of the mousePressEvent and mouseReleaseEvent handlers. To add the original QSlider behaviour again, you need to call the base class implementations, like:

              void VlcWidgetVolumeSlider::mousePressEvent(QMouseEvent *event)
              {
                 // ...
                  QSlider::mousePressEvent(event);
                 // ...
              }
              
              void VlcWidgetVolumeSlider::mouseReleaseEvent(QMouseEvent *event)
              {
                  // ...
                  QSlider::mouseReleaseEvent(event);
                 // ...
              }
              
              A 1 Reply Last reply 9 Oct 2016, 12:06
              4
              • ? A Former User
                9 Oct 2016, 11:38

                Orientation
                The orientation is controlled by the orientation propery; just set it to Qt::Horizontal.

                Mouse Issue
                The slider not correctly responding to mouse clicks is caused by the provided overrides of the mousePressEvent and mouseReleaseEvent handlers. To add the original QSlider behaviour again, you need to call the base class implementations, like:

                void VlcWidgetVolumeSlider::mousePressEvent(QMouseEvent *event)
                {
                   // ...
                    QSlider::mousePressEvent(event);
                   // ...
                }
                
                void VlcWidgetVolumeSlider::mouseReleaseEvent(QMouseEvent *event)
                {
                    // ...
                    QSlider::mouseReleaseEvent(event);
                   // ...
                }
                
                A Offline
                A Offline
                abhay
                wrote on 9 Oct 2016, 12:06 last edited by
                #7

                @Wieland Thank you very much :)

                ? 1 Reply Last reply 9 Oct 2016, 12:11
                1
                • A abhay
                  9 Oct 2016, 12:06

                  @Wieland Thank you very much :)

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on 9 Oct 2016, 12:11 last edited by A Former User 10 Sept 2016, 12:11
                  #8

                  @abhay Once your problem is solved, please mark the thread as solved and vote up ("like") the postings that have provided useful information. It only takes 5 seconds and helps to increase the quality of our forum. The Hitchhiker's Visual Guide to the Qt Forum shows how to do it. Thanks :-)

                  A 1 Reply Last reply 9 Oct 2016, 12:14
                  2
                  • ? A Former User
                    9 Oct 2016, 12:11

                    @abhay Once your problem is solved, please mark the thread as solved and vote up ("like") the postings that have provided useful information. It only takes 5 seconds and helps to increase the quality of our forum. The Hitchhiker's Visual Guide to the Qt Forum shows how to do it. Thanks :-)

                    A Offline
                    A Offline
                    abhay
                    wrote on 9 Oct 2016, 12:14 last edited by
                    #9

                    @Wieland Yeah...One more problem :( .Mouse icon is disappearing when I place it over the video output.Can you suggest me a solution to this problem ? Sorry for asking repeated questions.Thanks...

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on 9 Oct 2016, 12:38 last edited by A Former User 10 Sept 2016, 12:39
                      #10

                      I don't know what causes the cursor to be hidden, you'll have to read the widget's source code for that. I'd assume that you'll find a setCursor(Qt::BlankCursor) somewhere. Maybe you can force the cursor to be shown by calling VlcWidgetVideo::setCursor(Qt::ArrowCursor).

                      A 1 Reply Last reply 27 Oct 2016, 07:55
                      2
                      • ? A Former User
                        9 Oct 2016, 12:38

                        I don't know what causes the cursor to be hidden, you'll have to read the widget's source code for that. I'd assume that you'll find a setCursor(Qt::BlankCursor) somewhere. Maybe you can force the cursor to be shown by calling VlcWidgetVideo::setCursor(Qt::ArrowCursor).

                        A Offline
                        A Offline
                        abhay
                        wrote on 27 Oct 2016, 07:55 last edited by
                        #11

                        @Wieland Hi.Can you tell me where to place this code?

                        VlcWidgetVideo::setCursor(Qt::ArrowCursor).
                        

                        How to call and where to call this?

                        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