Hi everybody,

I've used the ARGB widget trick exposed in the WIKI for an advanced widget.

My main widget can grow with my childs widgets. If this is the case, the position of the main widget is changed. I've set an animated effect with a QBasicTimer.

I had a problem with the animation, sometimes there were a flickering during it : we can see a very short latency between the move at original size and when the new size is painted by the UpdateLayeredWindow function.

I have solve it like this :

Qt Code:
  1. topPos.x = myNewXpos; // instead of x(). Nice for animation but it sucks for mouseEvents
  2. topPos.y = myNewYpos; // instead of y(). Nice for animation but it sucks for mouseEvents
  3. ...
  4. UpdateLayeredWindow(winId(), screenDc, &topPos, &size, memDc, &pointSource, 0, &blend, ULW_ALPHA);
  5. move(myNewXpos, myNewYpos);
To copy to clipboard, switch view to plain text mode 

And I do the real move to synchronize the widget regarding its painted position on screen. It works like a charm ! The animation is now smooth.


The really big problem is with the mouse events on childs widget (or even a call to underMouse() on the adequate widget from the parent widget). It is totally wrong. I put a mousePressEvent on my childs widget but this is not the good widget that is seen as clicked (even if everything seems good with the event->globalPos() and with the child items mapToGlobalPos()).

The problem is really related to the topPos.x and topPos.y I don't set to x() and y().

Does someone has already encountered the same problem and deal with it ?

Sure, I have the idea to put an event filter on the main widget and decide myself which child widget has been clicked but I don't think it's elegant that Qt mouse events is disturbed by this. It sounds clearly like a design problem and it's bad.