summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qprintpreviewwidget.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-10 12:26:12 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-10 12:26:12 (GMT)
commitea953378e71afaa4b6eb7c95bbe2e507b2ab6a7c (patch)
tree47a26e1c68b49477a15a383caf6c1c1d0397c276 /src/gui/widgets/qprintpreviewwidget.cpp
parent03b28bf56b2edd76ca55ec6e3702db7bca69e757 (diff)
parent1fddb14c4d0ee82ac66c89061e8a20932f961883 (diff)
downloadQt-ea953378e71afaa4b6eb7c95bbe2e507b2ab6a7c.zip
Qt-ea953378e71afaa4b6eb7c95bbe2e507b2ab6a7c.tar.gz
Qt-ea953378e71afaa4b6eb7c95bbe2e507b2ab6a7c.tar.bz2
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/gui/widgets/qprintpreviewwidget.cpp')
-rw-r--r--src/gui/widgets/qprintpreviewwidget.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/widgets/qprintpreviewwidget.cpp b/src/gui/widgets/qprintpreviewwidget.cpp
index 16334b8..80c1271 100644
--- a/src/gui/widgets/qprintpreviewwidget.cpp
+++ b/src/gui/widgets/qprintpreviewwidget.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qprintpreviewwidget.h"
+#include "private/qwidget_p.h"
#include <private/qprinter_p.h>
#include <QtCore/qmath.h>
@@ -170,12 +171,12 @@ protected:
} // anonymous namespace
-class QPrintPreviewWidgetPrivate
+class QPrintPreviewWidgetPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QPrintPreviewWidget)
public:
- QPrintPreviewWidgetPrivate(QPrintPreviewWidget *q)
- : q_ptr(q), scene(0), curPage(1),
+ QPrintPreviewWidgetPrivate()
+ : scene(0), curPage(1),
viewMode(QPrintPreviewWidget::SinglePageView),
zoomMode(QPrintPreviewWidget::FitInView),
zoomFactor(1), initialized(false), fitting(true)
@@ -194,7 +195,6 @@ public:
void setZoomFactor(qreal zoomFactor);
int calcCurrentPage();
- QPrintPreviewWidget *q_ptr;
GraphicsView *graphicsView;
QGraphicsScene *scene;
@@ -518,7 +518,7 @@ void QPrintPreviewWidgetPrivate::setZoomFactor(qreal _zoomFactor)
\sa QWidget::setWindowFlags()
*/
QPrintPreviewWidget::QPrintPreviewWidget(QPrinter *printer, QWidget *parent, Qt::WindowFlags flags)
- : QWidget(parent, flags), d_ptr(new QPrintPreviewWidgetPrivate(this))
+ : QWidget(*new QPrintPreviewWidgetPrivate, parent, flags)
{
Q_D(QPrintPreviewWidget);
d->printer = printer;
@@ -534,7 +534,7 @@ QPrintPreviewWidget::QPrintPreviewWidget(QPrinter *printer, QWidget *parent, Qt:
preview.
*/
QPrintPreviewWidget::QPrintPreviewWidget(QWidget *parent, Qt::WindowFlags flags)
- : QWidget(parent, flags), d_ptr(new QPrintPreviewWidgetPrivate(this))
+ : QWidget(*new QPrintPreviewWidgetPrivate, parent, flags)
{
Q_D(QPrintPreviewWidget);
d->printer = new QPrinter;
@@ -551,7 +551,6 @@ QPrintPreviewWidget::~QPrintPreviewWidget()
Q_D(QPrintPreviewWidget);
if (d->ownPrinter)
delete d->printer;
- delete d_ptr;
}
/*!