How to use VLC-QT widgets as Qt widgets?
-
wrote on 9 Oct 2016, 10:05 last edited by
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!!
wrote on 9 Oct 2016, 10:13 last edited by@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
wrote on 9 Oct 2016, 10:18 last edited by@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!
-
wrote on 9 Oct 2016, 10:30 last edited by
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.
wrote on 9 Oct 2016, 11:00 last edited by@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..
wrote on 9 Oct 2016, 11:38 last edited byOrientation
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); // ... }
wrote on 9 Oct 2016, 12:06 last edited by@Wieland Thank you very much :)
-
wrote on 9 Oct 2016, 12:11 last edited by A Former User 10 Sept 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 :-)
-
@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 :-)
wrote on 9 Oct 2016, 12:14 last edited by@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...
-
wrote on 9 Oct 2016, 12:38 last edited by A Former User 10 Sept 2016, 12:39
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)
.wrote on 27 Oct 2016, 07:55 last edited by@Wieland Hi.Can you tell me where to place this code?
VlcWidgetVideo::setCursor(Qt::ArrowCursor).
How to call and where to call this?