PDA

View Full Version : How to move child widget with parent widget?



anupamgee
27th May 2009, 06:18
hi All,
I want to move my child widget on move of parent widget.I have tried move() child in moveEvent of parent. But movement of child is Delayed by parent's movement.


void parent::moveEvent(QMouseMoveEvent *event)
{
child->move(event->pos().x()-oldpos.x,event->pos().y()-oldpos.y);
}


How to move both the widget simultaneously.
thnx

jpn
9th June 2009, 19:44
Sounds like the child is not actually a child in QWidget terms, but just another window, is that right?

anupamgee
19th June 2009, 11:37
yes,child is a separate window.how to move them simultaneously?

Pembar
19th June 2009, 15:23
I have the same thing in the parent widget and the child moves along with it simultaneously.

I actually edited the eventFilter in dragmovecharm to call a function in the childwindow to "adjust" accordingly.

Regards,
Pembar