[Interest] how to get QMovie size without playing it first?

Frank Rueter | OHUfx frank at ohufx.com
Mon Jul 11 06:01:45 CEST 2016


Hi all,

I am playing with a gui that shows several QMovies which may have 
arbitrary sizes/aspects, and I'd like them all to live within the same 
sized QLabel for a neat layout.
So in order to scale them properly I assume I need to use 
QMovie.setScaledSize()?!
But the latter has no facility to keep the movie file's aspect ratio, so 
in order to use something like this:
     fileQSize.scale(displayQSize, QtCore.Qt.KeepAspectRatio)

I need to know the movie file's size/aspect.

It would seem that QT does not know the file's size until it has been 
played, and some examples I have seen on the web do this:
     movie.start()
     movie.stop()
     movie.currentImage().size()

or:
     movie.jumpToFrame(0)
     movie.currentImage().size()

Is this  the way to go or is there a tidier way?

Thanks in advance,
frank


-- 
ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
and consulting <http://ohufx.com/index.php/vfx-customising>* *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160711/b0e67aae/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ohufxLogo_50x50.png
Type: image/png
Size: 2666 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160711/b0e67aae/attachment.png>


More information about the Interest mailing list