Page 1 of 1

libVLC and Qt DockWidgets on OSX

Posted: 12 Jan 2018 06:54
by ghalter
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

Re: libVLC and Qt DockWidgets on OSX

Posted: 14 Jan 2018 11:18
by Jean-Baptiste Kempf
How are you embedding libVLC inside Qt?

Re: libVLC and Qt DockWidgets on OSX

Posted: 18 Jan 2018 12:52
by ghalter
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

Re: libVLC and Qt DockWidgets on OSX

Posted: 20 Jan 2018 19:31
by Jean-Baptiste Kempf
OK, it seems this is related to upstream Qt and the way we are drawing.

Re: libVLC and Qt DockWidgets on OSX

Posted: 13 Aug 2019 09:14
by ghalter
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)