From 2f002ef720412dc834daac46843d1439dc49680f Mon Sep 17 00:00:00 2001 From: Jesus Sanchez-Palencia Date: Thu, 28 May 2009 17:20:36 -0300 Subject: QGraphicsAnchorLayout: Making private class inherit from QGraphicsLayoutPrivate Signed-off-by: Jesus Sanchez-Palencia --- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 8 +++----- src/gui/graphicsview/qgraphicsanchorlayout.h | 1 - src/gui/graphicsview/qgraphicsanchorlayout_p.h | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index d737e36..d91b4ab 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -42,12 +42,10 @@ #include "qgraphicsanchorlayout_p.h" QGraphicsAnchorLayout::QGraphicsAnchorLayout(QGraphicsLayoutItem *parent) - : QGraphicsLayout(parent), d_ptr(new QGraphicsAnchorLayoutPrivate()) + : QGraphicsLayout(*new QGraphicsAnchorLayoutPrivate(), parent) { - // ### REMOVE THAT - d_ptr->q_ptr = this; - - d_ptr->createLayoutEdges(); + Q_D(QGraphicsAnchorLayout); + d->createLayoutEdges(); } QGraphicsAnchorLayout::~QGraphicsAnchorLayout() diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h index 288aec1..2093b15 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout.h @@ -89,7 +89,6 @@ public: ///////// DEBUG ///////// void dumpGraph(); - QGraphicsAnchorLayoutPrivate *d_ptr; //### TO REMOVE protected: private: diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index e8f5783..65315fb 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -41,6 +41,7 @@ #include +#include "qgraphicslayout_p.h" #include "qgraphicsanchorlayout.h" #include "qgraph_p.h" #include "qsimplex_p.h" @@ -196,10 +197,9 @@ public: QGraphicsAnchorLayout private methods and attributes. */ -class QGraphicsAnchorLayoutPrivate +class QGraphicsAnchorLayoutPrivate : public QGraphicsLayoutPrivate { Q_DECLARE_PUBLIC(QGraphicsAnchorLayout) - QGraphicsAnchorLayout *q_ptr; public: // When the layout geometry is different from its Minimum, Preferred -- cgit v0.12