Moving the widget seems to be the default behaviour of the widget.
To draw on the widget implement the mousepress, mousemove and mouse release events... and override the paintevent to draw inside the widget...
check the code attached...
Moving the widget seems to be the default behaviour of the widget.
To draw on the widget implement the mousepress, mousemove and mouse release events... and override the paintevent to draw inside the widget...
check the code attached...
Yes, that sure a way to prevent the widget from moving, thanks.
But I don` understand why default widget behaviour in QWorkspace is different from standard behaviour.
For widgets like QStatusBar inside a MdiChild it is a bit freaky, to reimplement QStatusBar and override mouse events, just to prevent the MdiChild from accidently moving.
If I understand the concept correctly, then you only need to reimplement those events for direct children of the workspace, so if you don't use floating QStatusBar widgets, you won't need to touch them. Anyway I think that's not needed as well, as you can probably do everything by reimplementing mouse events in QWorkspace (there probably is an event filter installed somewhere, so even that might not be necessary).
Bookmarks