[PyQt] Problem with a widget [PyQt5]
Maurizio Berti
maurizio.berti at gmail.com
Sat Feb 22 05:38:35 GMT 2020
If you don't add the video widget to the layout, it will never be shown.
Check and update the following lines:
self.video_contenedor = QVideoWidget()
# ...
self.media = QMediaPlayer(None, QMediaPlayer.VideoSurface)
That said:
1. Video playback might not work, that depends on the system, the platform
plugins and lots of other different variables Qt relies too much onto. You
might want to look for alternatives, such as embedding VLC or MPD players
instead.
2. Rethink your whole GUI layout *and* variable/attribute naming, as they
are totally confusing and inconsistent.
3. The next time you ask for help, please provide less cluttered code, with
more coherent naming and interface, and always remove **all** unnecessary
code: it took me 10 minutes to understand the structure of your UI, because
of unnecessary layouts and widgets. When asking for help, always provide a
code that is as minimal as possible (but still reproducible): it might take
a lot of time on your part, but while an hour for you could mean a minute
for somebody who could give you a fast answer, a careless code posting will
surely result in people being annoyed with code difficult to understand;
the result is easy: if your code is hard to read, even if the answer is
easy, nobody will reply.
4. Please always provide code that uses easy to read variables and object
names in english language. There is a lot of people who don't speak english
as first language, which means that even more won't understand what
"video_contenedor" means. In programming, this means that that variable has
a random name that's has no meaning at all, which will make it really hard
to understand what it refers to.
Il giorno ven 21 feb 2020 alle ore 21:32 Nikola Tesla <rubymotions at gmail.com>
ha scritto:
>
>
>
>
>
> *Hey, how are you? I hope you're well. my problem is that I'm trying to
> add the class video = QVideoWidget() in this widget -->
> self.video_container = QWidget(self.box_video) but I haven't been able to
> work it out... please help I have attached the code file to make my
> question more understandable*
>
>
> *This is so that the uploaded video can be displayed in that widget*
>
> *This widget is illustrated in the attached image*
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
--
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200222/3cc52bf1/attachment.html>
More information about the PyQt
mailing list