[Interest] Animation control and high DPI effects
Bob Hood
bhood2 at comcast.net
Tue Sep 29 22:58:35 CEST 2015
Hi, guys. This may be a little rambling, so I apologize.
I recently re-wrote an older, stand-alone application that was using a fairly
archaic framework to use Qt5. In designing the UI, I implemented some
animation support (via QPropertyAnimation) on the widgets on the interface. I
found that you cannot apply animations to Layouts, but rather can only animate
widgets directly. When I tried to animate Layouts, they simply did not
respond. For example, I put a QLabel into a QVBoxLayout and then tried to
apply a QPropertyAnimation to the QVBoxLayout, and it did not move at all.
Removing the QVBoxLayout, the QLabel responds to the animation control when
applied. So, my interface doesn't use any Layouts, and the animations
function well when everything is properly positioned.
However, I'm seeing that the QLabel is not responding properly to changes in
the DPI setting under Windows. The text in the label is scaling, but it is
getting clipped because its bounding rectangle remains the same size. Without
having to manually hack the font or rectangle sizes at run time, is there some
kind of setting for the widgets to get them to handle this change more
gracefully? I imagine that a Layout control would provide more automated
scaling adjustments, but I'm wondering if it is really either/or: Either I
gracefully support DPI scaling, or I have animation.
Thanks for your gracious enlightenment. :)
More information about the Interest
mailing list