I would like create a dialog screen with a gif which runs while function1 is loading (writing files etc)
and maybe animate a gif file in the main windows (maybe in a angle of the screen or in the right side of the button which run the function1 when clicked) during function1 is running.
Yes, you would use QMovie to load a GIF file, and perhaps use a QLabel to display it.
If function1 (which should be a method containing a self parameter) takes a long time to run, you will need to make sure that the application’s event loop keeps running. This will ensure that the user interface does not freeze. There are a few different approaches to doing this.
First, verify that you can display a GIF file in a label, and that it animates as you expect. Then, look at ways to implement function1.