PDA

View Full Version : QWinWidget is not visible with MFC GroupBox



dpace
24th January 2012, 02:51
I have a QWinWidget containing a custom QWidget in an MFC dialog. The QWinWidget appears to be invisible. I can interact with it using the mouse as though it was visible but it is not visible.

The QWinWidget is inside the area of a GroupBox and this appears to be the issue. If I place the QWinWidget outside of the area of the GroupBox, it is visible. The z-order order of the controls matters as well. If I place the GroupBox above the QWinWidget in the rc file (such that it would receive tab focus first), the QWinWidget is invisible. If I place the GroupBox below the QWinWidget in the rc file, the QWinWidget appears.

I've seen this behavior in multiple dialogs with different QWinWidgets. The issue does not occur with other MFC controls that are above or below in the z-order.

Does anyone have any ideas on what might be wrong here?

dpace
24th January 2012, 19:39
I stepped into paintEvent() of the QWidget (the child of the QWinWidget) and it appears to be painting itself with a reasonable rect yet it does not appear on the screen. If the GroupBox partially intersects the QWinWidget's rect, the QWinWidget is partially visible and appears to be clipped.

This one is stumping me. Anyone have any ideas where I might try debugging further?