I use QWinWidget inside the MFC dialog, and QWinWidget does not correctly draw and does not handle keyboard input correctly.
Repainting [Unauthorized]
In QWinWidget, I have a QTableWidget. When I look at the QTableWidget, it does not redraw until I stop scrolling, and at that moment it redraws everything. Likewise, I can enter cells in a QTableWidget, and the control does not refresh until I force it to re-refresh by scrolling up or down (it refreshes when the scroll stops).
Since this QWinWidget is located in the CDialog MFC, I tried to override the Onial method for CDialog and only call the QWinWidget :: repaint method, however this has the opposite problem when only QWinWidget is updated and CDialog never redraws, resulting in artifacts. If I call QWinWidget :: repaint and CDialog :: OnPaint, the result is the same as not overriding the OnPaint method. Has anyone seen this problem or knew how to solve it?
Keyboard input [enabled]
None of the controls in QWinWidget will correctly respond to tabs or arrow keys. The tab / arrow keys simply skip the entire QWinWidget (and all child controls). Even if I click inside the QWinWidget and select the control, the next time I press the Tab key, it completely disables focus from the whole QWinWidget.
I noticed that QWinWidget has two functions: QWinWidget :: focusNextPrevChild and QWinWidget :: focusInEvent, and both of them have a comment header with the inscription "\ reimp". Do I have to override these functions in order to get the correct tab functionality? If so, how can these functions be implemented to properly configure the tab.
source
share