QPrintPreviewDialog is a normal dialog. So just use QWidget::geometry or QWidget::adjustSize().