'Animating a frame to pop out of the bottom of the app without shrinking the height of other elements

I'm working on a desktop application for windows using PyQt and Qt creator.

What I want

I want to display messages to the user only when the user gave an input. I also wanted the message to draw the eye, so I'm going for the following animated solution:

A frame that's hidden when not required (with height = 0 and width = the app's width), 'grows' from the bottom of the app when needed, stays visible for 5-6 seconds, then retracts back to the bottom.

The app kind of looks like this without the message:

looks without the message

And kind of like this when the message IS displayed (note how the bottom gray element is 'covered' by the message):

looks when message is displayed

What I tried

So the way I did this was to create what I called "footer frame", which contains another frame that I call "message frame". The message frame contains a label that will hold, in time, the message for the user. Everything has pre-determined height, so to hide the whole thing I set the message frame to have a maximum height of 0.

So for the 'growing' animation I animated the message frame's maximumHeight property.

The current problem

THING IS - since I wanted the app to be responsive I put everything in layouts... and because of that, whenever the message is displayed, the rest of the components are 'compressed' in height. kind of like this (note how the bottom gray element is not covered by the message, but all the elements' heights shrink a little):

compressed when displaying message

Instead, I wanted the messsage to 'cover' whatever is located under the message's coordinates.

I tried to animate the geometry of the message frame, but nothing really happened - probably because the minimum height is still 0. So I tried to change the minimum height right before the animation begins; But that led to that compression again. Tried to do the same with the footer frame, with the same results.

My question is : What is the best / preferred way of achieving the result I intend with Qt?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source