How to use VLC-QT widgets as Qt widgets?
-
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!!
-
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!!
@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
-
@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
@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!
-
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.
-
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.
@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..
-
@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..
Orientation
The orientation is controlled by the orientation propery; just set it toQt::Horizontal
.Mouse Issue
The slider not correctly responding to mouse clicks is caused by the provided overrides of themousePressEvent
andmouseReleaseEvent
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); // ... }
-
Orientation
The orientation is controlled by the orientation propery; just set it toQt::Horizontal
.Mouse Issue
The slider not correctly responding to mouse clicks is caused by the provided overrides of themousePressEvent
andmouseReleaseEvent
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); // ... }
-
@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 :-)
-
@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 :-)
-
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 callingVlcWidgetVideo::setCursor(Qt::ArrowCursor)
. -
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 callingVlcWidgetVideo::setCursor(Qt::ArrowCursor)
.