diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
commit | 7604f8087f88171ef933d8ae08f501467e647338 (patch) | |
tree | 51d071f462ed48d0b25884d9f62b8ba11c5dff13 /src/gui/dialogs/qprintpreviewdialog.cpp | |
parent | 8c265860b41214daade7c8a28237c1e07ea71a3c (diff) | |
download | Qt-7604f8087f88171ef933d8ae08f501467e647338.zip Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2 |
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions,
which also contains the full history.
Rev-By: Harald Fernengel
Rev-By: Ralf Engels
Diffstat (limited to 'src/gui/dialogs/qprintpreviewdialog.cpp')
-rw-r--r-- | src/gui/dialogs/qprintpreviewdialog.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp index c00bd14..61949d8 100644 --- a/src/gui/dialogs/qprintpreviewdialog.cpp +++ b/src/gui/dialogs/qprintpreviewdialog.cpp @@ -42,6 +42,7 @@ #include "qprintpreviewdialog.h" #include "qprintpreviewwidget.h" #include <private/qprinter_p.h> +#include "private/qdialog_p.h" #include <QtGui/qaction.h> #include <QtGui/qboxlayout.h> @@ -128,12 +129,12 @@ private: }; } // anonymous namespace -class QPrintPreviewDialogPrivate +class QPrintPreviewDialogPrivate : public QDialogPrivate { Q_DECLARE_PUBLIC(QPrintPreviewDialog) public: - QPrintPreviewDialogPrivate(QPrintPreviewDialog *q) - : q_ptr(q), printDialog(0), ownPrinter(false), + QPrintPreviewDialogPrivate() + : printDialog(0), ownPrinter(false), initialized(false) {} // private slots @@ -158,7 +159,6 @@ public: void updatePageNumLabel(); void updateZoomFactor(); - QPrintPreviewDialog *q_ptr; QPrintDialog *printDialog; QPrintPreviewWidget *preview; QPrinter *printer; @@ -680,7 +680,7 @@ void QPrintPreviewDialogPrivate::_q_zoomFactorChanged() \sa QWidget::setWindowFlags() */ QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt::WindowFlags flags) - : QDialog(parent, flags), d_ptr(new QPrintPreviewDialogPrivate(this)) + : QDialog(*new QPrintPreviewDialogPrivate, parent, flags) { Q_D(QPrintPreviewDialog); d->init(printer); @@ -694,7 +694,7 @@ QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt: system default printer. */ QPrintPreviewDialog::QPrintPreviewDialog(QWidget *parent, Qt::WindowFlags f) - : QDialog(parent, f), d_ptr(new QPrintPreviewDialogPrivate(this)) + : QDialog(*new QPrintPreviewDialogPrivate, parent, f) { Q_D(QPrintPreviewDialog); d->init(); @@ -709,7 +709,6 @@ QPrintPreviewDialog::~QPrintPreviewDialog() if (d->ownPrinter) delete d->printer; delete d->printDialog; - delete d_ptr; } /*! |