Hi all!

There is some modal dialogs in my app, and I want those dialogs to be shown centered relatively to the main window of the app. Every dialog is subclassed form QDialog, has its own constructor and is invoked by QDialog::exec() method. Correct parent is passed to every dialog upon initialization.

Everything works fine and the dialogs are shown centered in relation to their parent window unless I add the following line to the constructor of any dialog:

Qt Code:
  1. setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint );
To copy to clipboard, switch view to plain text mode 

Whenever this line is added, the dialog is always shown at the arbitrary lacation close to the top-left corner of the main window.

Can someone explain what's happening here? And what's the best solution for this case (I have to remove that question mark from the dialogs anyway).

Thanks in advance.