[Interest] Flickering when animating QWidget resize

Michael Jackson mike.jackson at bluequartz.net
Fri Aug 25 22:08:06 CEST 2017


We also tried an OpenGLWidget with an image being rendered by OpenGL but we still get flicker. We are trying to embed the widget in a QScrollArea and then resize the QScrollArea any maybe that gives us a reasonable effect.

I would go down the QML road but we would have to port quite a number of custom QWidgets to QML to be able to display what we need. I think in the end we will rethink the UX and not have anything "Flashy" in our QWidgets based app.

I do appreciate everyone's thoughts and suggestions.

---
Mike Jackson

On 8/25/17, 4:00 PM, "Interest on behalf of Konstantin Tokarev" <interest-bounces+mike.jackson=bluequartz.net at qt-project.org on behalf of annulen at yandex.ru> wrote:


25.08.2017, 22:45, "André Pönitz" <apoenitz at t-online.de>:
> On Fri, Aug 25, 2017 at 10:26:22AM -0700, Thiago Macieira wrote:
>>  On Friday, 25 August 2017 09:26:22 PDT Michael Jackson wrote:
>>  > In our application, we are attempting to create a "fly out" effect with a
>>  > QWidget based window and when the animation happens the QWidget flickers
>>  > badly. We are usig QProperty animation in an attempt to achieve the effect.
>>  > Is this not a good idea? Is there a setting that we are missing perhaps?
>>
>>  It's not a good idea to animate QWidgets. They were not designed for that.
>
> And still it works.
>
>>  At the very least, make your animations inside a QGraphicsView. Better yet,
>>  use QML and/or OpenGL.
>
> Simply calling QWidget::update() from a timer works just fine for
> simple effects like e.g. the hover effect on the Examples and
> Tutorials pages on Qt Creator's Welcome screen.
>
> There's no need for QGraphicsView, let alone OpenGL for that.

Still, animations with "moving widgets" work better when there are no really moving widgets,
e.g. when widgets content is renderend into image/pixmap before animation starts.
Bonus points if this image/pixmap is somehow "hw-accelerated" to achieve fast blits.

All this stuff is not easy to get right from the start, and on many devices including modern PCs
and many embedded things the only way to achieve this kind of "acceleration" is OpenGL

>
> Andre'

-- 
Regards,
Konstantin






More information about the Interest mailing list