libVLC and Qt DockWidgets on OSX

This forum is about all development around libVLC.
ghalter
New Cone
New Cone
Posts: 5
Joined: 12 Jan 2018 06:30

libVLC and Qt DockWidgets on OSX

Postby ghalter » 12 Jan 2018 06:54

Hey everybody,

First of all: Thank you so much for libVLC, it is truly awesome!

I'm currently developing a movie-annotation application using libVLC and Qt.
While everything works as expected on Windows and Ubuntu, I have the strange issue, that QDockWidgets get broken by the VLC-Instance
on OSX. I'm not completely clear what happens, but it seems like VLC is taking Focus while the DockWidget is getting dragged, docked or undocked, leading to a completely
unpredictable behaviour.

The behaviour can be reproduced using PyQt or C++ Qt.

My Question is now, if someone does know more about this, or could maybe imagine why this could happend, and if there is a workaround for this issue.

thanks for your answers in advance.
Gaudenz

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: libVLC and Qt DockWidgets on OSX

Postby Jean-Baptiste Kempf » 14 Jan 2018 11:18

How are you embedding libVLC inside Qt?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ghalter
New Cone
New Cone
Posts: 5
Joined: 12 Jan 2018 06:30

Re: libVLC and Qt DockWidgets on OSX

Postby ghalter » 18 Jan 2018 12:52

Hey Jean-Baptiste,

I'm essentially using an adaption of the PyQT4 tutorial I found somewhere.
I have written a minimal example to reproduce this problem in python:

I'm using python3 and anacondas pyqt 5.6.0.
https://github.com/ghalter/CodeSnippets ... LC/demo.py

While I have not tested it in C++, I've seen that a similar issue has been reported in the vlc-qt repo:
https://github.com/vlc-qt/vlc-qt/issues/174

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: libVLC and Qt DockWidgets on OSX

Postby Jean-Baptiste Kempf » 20 Jan 2018 19:31

OK, it seems this is related to upstream Qt and the way we are drawing.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ghalter
New Cone
New Cone
Posts: 5
Joined: 12 Jan 2018 06:30

Re: libVLC and Qt DockWidgets on OSX

Postby ghalter » 13 Aug 2019 09:14

This is super old, but turns out I just found a solution today.

This behaviour can be solved by setting Qt::AA_DontCreateNativeWidgetSiblings.
right after creating the QApplication:

Code: Select all

app = QApplication(sys.argv) app.setAttribute(Qt.AA_DontCreateNativeWidgetSiblings)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 20 guests