View Full Version : Focus or update problem in modal QDialog

16th January 2010, 10:37
I have a QDialog class with several child widgets, such as radio buttons, line edits etc. I create the dialog from a QMainWindow by calling its exec function. However, most of the time the dialog does not seem to be updated correctly. The child widgets does not behave as expected, in particular I am not able to tab switch between the child widgets and when I type something in a line edit, the text does not show until the line edit loses focus. When I create and close the dialog multiple times in a row, the strange behavior happens maybe about half the time, the rest of the time it behaves completely normally. There seems to be no predictable order when it behaves ok and when it does not.

I initially thought it was a focus problem, but now I rather believe it is a problem of updating/redrawing the dialog. It seems to me that the dialog behaves functionally as it should, but that the widgets are only updated visually when they lose focus. Is there a way to control this in Qt? Any ideas on what could be the problem? I am particularly confused because of the irregular occurrence of the problem.

19th January 2010, 22:32
What plattform are you using? From your header I see that you are using both X11 and Windows. Does this behaviour happen on both plattforms?