[Interest] Glueing widgets together

Bo Thorsen bthorsen at ics.com
Fri Jun 28 09:28:51 CEST 2013

Den 28-06-2013 09:18, Sensei skrev:
> Dear all,
> I've posted some time ago a question about moving widgets
> simultaneously. However, the proposed solutions were unsatisfactory.
> That is probably because I've expressed my needs in a non useful way. So
> here it goes.
> 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?

Not directly, no.

If they are just next to each other, throw them in the same parent and 
move the parent instead. That would work.

Or you can do a hack. For example, try taking a snapshot of the two 
widgets and construct a png with them, then use this as a drag object icon.

All ideas I can think of come to one single conclusion: You have to 
somehow modify the problem from "how do I move two things 
simultaneously" to "how can I trick the user to move one thing but think 
he moves two".


Bo Thorsen, European Qt Manager, Integrated Computer Solutions
ICS - Delivering World-Class Applications for Embedded & Mobile Devices

More information about the Interest mailing list