[Interest] Glueing widgets together

Richard Moore rich at kde.org
Fri Jun 28 10:53:07 CEST 2013


On 28 June 2013 08:28, Bo Thorsen <bthorsen at ics.com> wrote:
>> I need to "glue together" two widgets, so that when one moves, the other
>> *simultaneously* moves.
>>
>> They should appear glued even when dragging around, fast and slow. Like
>> if the "follower" is simply painted over the moving widget.
>>
>> The proposed solutions involve getting the mouse move events dealt with.
>> This resulted in a visible delay, and that isn't what I want: I don't
>> want to see the window moving with the follower staying still, and after
>> few instants, the follower (disappearing from where it was) painted in
>> the right position.
>>
>> Is there any way I can achieve this visual effect?

When you 'glue' them together, reparent both of them into a container
QWidget. Then when you move them around, you simply move the
container.

Rich.



More information about the Interest mailing list