PDA

View Full Version : QpaintEvent region problem with QPopupmenus



Qtkiller
20th September 2007, 16:51
Hi,

I have the strange problem that, when I click on a popupmenu, fully outside or inside a widget, the widget repaints with an updated region that is is the whole widget instead of a part of the widget.

Only when I move a windows form over the widget, the updated region is correct. When Qt is the sender of the paintevent, the updated region will fail.

Has anyone a solution for this ??

I use Qt 3.3.4

Qtkiller
21st September 2007, 10:18
I explain it more.

I am not sure if Qt is the sender of the event. When I click on a QMenubar,that contains QPopupmenu's, BEFORE the popupmenu is shown there is a complete paintevent of the widget. When I click outside the QMenuBar to close the popupmenu, a new paintevent is generated, while there is no need to do this.

These are 2 "wild" paintevents that are not needed. The widget is in a QWorkspace, this workspace has as parent a CVBox. This CVBox has as parent a QMainWindow. The QMenubar resides on the QMainWindow.

EDIT

problem is solved. Probably a Qt bug. There is nothing wrong with a QPopupMenu, it has todo with the focus. When a form outside the QT application gets the focus, the qt application receives a weird paintevent. Also when a QT application gets focus, a complete paint event occurs. I solved it, thanks to my my colleague, with a own empty implementation of a focusInEvent and focusOutEvent function.