Are there existing ways to move several instances of QWidget simultaneously, without jittering?
-
I have several instances of QWidget objects. One of them is a chief widget, rest are the child-widgets.
When I move the chief widget all child-widgets should move on the same offset.
I tried to implement it in two ways:- In the chief widget call installEventFilter() for each child-widgets and move controlled for QEvent::Move event.
- Override void moveEvent(QMoveEvent* event) in chief-widget and call move for each child-widgets.
It works, but I observe the jittering when child-widgets move in both cases.
I suppose it happens due to the not-synchronous widgets redrawing.
Is it possible to solve this problem with special Qt-tricks? -
I have several instances of QWidget objects. One of them is a chief widget, rest are the child-widgets.
When I move the chief widget all child-widgets should move on the same offset.
I tried to implement it in two ways:- In the chief widget call installEventFilter() for each child-widgets and move controlled for QEvent::Move event.
- Override void moveEvent(QMoveEvent* event) in chief-widget and call move for each child-widgets.
It works, but I observe the jittering when child-widgets move in both cases.
I suppose it happens due to the not-synchronous widgets redrawing.
Is it possible to solve this problem with special Qt-tricks?@nen777w
I admit I have not tried, but if you mean they others are child widgets of the "chief" widget and you move that, I would have expected the child widgets to move with it, maintaining their relative positions. You say they do not? Are you using layouts to position children within parent or not? -
@nen777w
I admit I have not tried, but if you mean they others are child widgets of the "chief" widget and you move that, I would have expected the child widgets to move with it, maintaining their relative positions. You say they do not? Are you using layouts to position children within parent or not? -
@JonB No, I just use words "chief" and "child" instead of the "master" and "slave".
In any case, these widgets are independent of each other but should move together. -
@nen777w not sure how you lay them out. One possible way to try:
create a widget to hold all of them and move this widget. -
@JoeCFD In this case, if the child-widget is out of the chief widget it will not be visible.
-
Hm....!
Interesting found!
If I call for the child-widgetsetWindowFlags(Qt::ToolTip);the jittering disappears. It looks like it helps to synchronize widget painting.
Or even better:Qt::Window|Qt::FramelessWindowHintp.s.
My fault.
The problem is not solved.
I played with that and found that these flags do not eliminate jittering completely, they just make it less obvious. -
Hm....!
Interesting found!
If I call for the child-widgetsetWindowFlags(Qt::ToolTip);the jittering disappears. It looks like it helps to synchronize widget painting.
Or even better:Qt::Window|Qt::FramelessWindowHintp.s.
My fault.
The problem is not solved.
I played with that and found that these flags do not eliminate jittering completely, they just make it less obvious.