path: root/src/printsupport/dialogs/qabstractprintdialog_p.h
diff options
authorThiago Macieira <>2018-04-25 22:23:14 -0700
committerThiago Macieira <>2018-04-26 16:15:30 +0000
commit26e3dfd4ab25f578a988703e693d7cd073277bd6 (patch)
tree64afbf4eefc786760a6eb8c9c4f7fd376fab38d1 /src/printsupport/dialogs/qabstractprintdialog_p.h
parent7c3053b301a70b04f5ab4ed9c3f3a6c84cb89616 (diff)
Improve padding hole issues in QAbstractPrintDialogPrivate
Placing a boolean between two pointers means we'll have a 7-byte padding hole (64-bit). So move it to the bottom of the class, consuming the tail padding that needs to be there anyway on 64-bit systems. On 32-bit Unix systems, the better place would be at the top, as the parent class (QDialogPrivate) has a 3-byte tail padding. But that's fragile, as QDialogPrivate can change, doesn't apply to MSVC's ABI and doesn't gain us anything on 64-bit. Change-Id: I3840d727dee443318644fffd1528e4f05f4142bd Reviewed-by: Lars Knoll <>
Diffstat (limited to 'src/printsupport/dialogs/qabstractprintdialog_p.h')
1 files changed, 4 insertions, 3 deletions
diff --git a/src/printsupport/dialogs/qabstractprintdialog_p.h b/src/printsupport/dialogs/qabstractprintdialog_p.h
index a17a28f564..b646b74f34 100644
--- a/src/printsupport/dialogs/qabstractprintdialog_p.h
+++ b/src/printsupport/dialogs/qabstractprintdialog_p.h
@@ -69,16 +69,15 @@ class QAbstractPrintDialogPrivate : public QDialogPrivate
- : printer(nullptr), pd(nullptr), ownsPrinter(false)
+ : printer(nullptr), pd(nullptr)
, options(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintPageRange |
QAbstractPrintDialog::PrintCollateCopies | QAbstractPrintDialog::PrintShowPageSize),
- minPage(0), maxPage(INT_MAX)
+ minPage(0), maxPage(INT_MAX), ownsPrinter(false)
QPrinter *printer;
QPrinterPrivate *pd;
- bool ownsPrinter;
QPointer<QObject> receiverToDisconnectOnClose;
QByteArray memberToDisconnectOnClose;
@@ -88,6 +87,8 @@ public:
void setPrinter(QPrinter *newPrinter);
int minPage;
int maxPage;
+ bool ownsPrinter;