Don't pick the modality type based on the presences of a parent widget,
use QWidget::windowModality() instead. If modality hasn't been
specified, then use presence of the parent to chose an appropriate
modality type.
Change-Id: Ib39c166ba3293174c55748f63222367e3e1c56bc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
QDialog::setVisible(visible);
if (visible) {
- d->openCocoaPageLayout(parentWidget() ? Qt::WindowModal
- : Qt::ApplicationModal);
+ Qt::WindowModality modality = windowModality();
+ if (modality == Qt::NonModal) {
+ // NSPrintPanels can only be modal, so we must pick a type
+ modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal;
+ }
+ d->openCocoaPageLayout(modality);
return;
} else {
if (d->pageLayout) {
QDialog::setVisible(visible);
if (visible) {
- d->openCocoaPrintPanel(parentWidget() ? Qt::WindowModal
- : Qt::ApplicationModal);
+ Qt::WindowModality modality = windowModality();
+ if (modality == Qt::NonModal) {
+ // NSPrintPanels can only be modal, so we must pick a type
+ modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal;
+ }
+ d->openCocoaPrintPanel(modality);
return;
} else {
if (d->printPanel) {