Fix Presentation Mode VideoWidget sizing

This fix smells a lot like a workaround for a bug in Qt but i could not
write down a sufficiently small testcase for it to report it to Qt, and
this is not wrong anyway since we eventually add playerPage to a
layout for this. What I tracked down was that since playerPage had no
parent, at some point a nativeId for it was being created and that
broke sizing back to the default 100x30 used in Qt instead of the
size we had given it.

For some reason i needed a PDF file with more than one video to
reproduce this problem, the first video was correctly sized but the
second one was 100x30.
This commit is contained in:
Albert Astals Cid 2018-04-02 21:18:00 +02:00
parent 0a91e0fbee
commit 09109dd649

View file

@ -232,7 +232,7 @@ VideoWidget::VideoWidget( const Okular::Annotation *annotation, Okular::Movie *m
setAttribute( Qt::WA_NoMousePropagation );
// Setup player page
QWidget *playerPage = new QWidget;
QWidget *playerPage = new QWidget( this );
QVBoxLayout *mainlay = new QVBoxLayout( playerPage );
mainlay->setMargin( 0 );