path: root/src/printsupport
diff options
authorGiuseppe D'Angelo <>2019-05-13 21:59:06 +0200
committerMarc Mutz <>2019-05-15 04:59:22 +0000
commit92479ed9b76fed17afd138d2222b8df86163cd6c (patch)
tree488c2ea138c2ba5e8001fbac7194c56427cf5b7f /src/printsupport
parent83971776c7ec0ae8e27ff554d20db08019ecb3d1 (diff)
QPrintSupport: do not bypass a base class' virtual
QAbstractPrintDialog (a QDialog subclass) has an interesting override of exec(): a pure virtual, without a body. The UNIX subclass was therefore forced to override it, but since it did not need to do anything with it, it had to call QDialog::exec (bypassing the direct base, otherwise it would cause a pure virtual call). Eliminate the pure virtual override. This should be BC; the layout of the vtable does not change, merely its contents. Change-Id: I84ac23c938f1934f699df032ef1bde0d6df77784 Reviewed-by: Thiago Macieira <> Reviewed-by: Lars Knoll <>
Diffstat (limited to 'src/printsupport')
2 files changed, 1 insertions, 3 deletions
diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h
index 3cc89890fc..9817810c61 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.h
+++ b/src/printsupport/dialogs/qabstractprintdialog.h
@@ -84,8 +84,6 @@ public:
explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
- int exec() override = 0;
// obsolete
void addEnabledOption(PrintDialogOption option);
void setEnabledOptions(PrintDialogOptions options);
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 6eaf24adf9..5136ba13e5 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -1082,7 +1082,7 @@ void QPrintDialog::setVisible(bool visible)
int QPrintDialog::exec()
- return QDialog::exec();
+ return QAbstractPrintDialog::exec();
void QPrintDialog::accept()