If a window manager doesn't position dialog windows, then
they are centered on a parent window by Qt.
DialogStateSaver::restoreWindowState() is called before
a layout is set for DialogBase and thus it resizes
DialogBase to (-1, -1) returned by DialogBase::sizeHint().
Qt centers the dialog with such size on its parent,
but the dialog changes its size in DialogBase::showEvent()
and becomes uncentered.
Setup the layout before DialogBase::showEvent() to fix it.