diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-04 08:59:11 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-04 08:59:18 +0200 |
commit | 216f57ef8682f74b72ae4e39cf1fd23abddf6a51 (patch) | |
tree | 9d1dc12e0944ec0252dac843fbadaf1dc4693888 /src/widgets/graphicsview | |
parent | 36bc2477753d19a14c587b97d4ec4f263e9e16c0 (diff) | |
parent | 8ce657d0279566ef327af1b88339534041ddc012 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsgridlayout.cpp | 9 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicslinearlayout.cpp | 10 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview.cpp | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/widgets/graphicsview/qgraphicsgridlayout.cpp b/src/widgets/graphicsview/qgraphicsgridlayout.cpp index 422193d4dd..ae761d3478 100644 --- a/src/widgets/graphicsview/qgraphicsgridlayout.cpp +++ b/src/widgets/graphicsview/qgraphicsgridlayout.cpp @@ -89,6 +89,7 @@ #include "qgraphicswidget.h" #include "qgraphicsgridlayoutengine_p.h" #include "qgraphicslayoutstyleinfo_p.h" +#include "qscopedpointer.h" #ifdef QT_DEBUG # include <QtCore/qdebug.h> #endif @@ -98,10 +99,10 @@ QT_BEGIN_NAMESPACE class QGraphicsGridLayoutPrivate : public QGraphicsLayoutPrivate { public: - QGraphicsGridLayoutPrivate(): m_styleInfo(0) { } + QGraphicsGridLayoutPrivate() { } QGraphicsLayoutStyleInfo *styleInfo() const; - mutable QGraphicsLayoutStyleInfo *m_styleInfo; + mutable QScopedPointer<QGraphicsLayoutStyleInfo> m_styleInfo; QGraphicsGridLayoutEngine engine; #ifdef QGRIDLAYOUTENGINE_DEBUG @@ -113,8 +114,8 @@ public: QGraphicsLayoutStyleInfo *QGraphicsGridLayoutPrivate::styleInfo() const { if (!m_styleInfo) - m_styleInfo = new QGraphicsLayoutStyleInfo(this); - return m_styleInfo; + m_styleInfo.reset(new QGraphicsLayoutStyleInfo(this)); + return m_styleInfo.data(); } /*! diff --git a/src/widgets/graphicsview/qgraphicslinearlayout.cpp b/src/widgets/graphicsview/qgraphicslinearlayout.cpp index 524649bf12..6763af7905 100644 --- a/src/widgets/graphicsview/qgraphicslinearlayout.cpp +++ b/src/widgets/graphicsview/qgraphicslinearlayout.cpp @@ -122,6 +122,7 @@ #include "qgraphicswidget.h" #include "qgraphicsgridlayoutengine_p.h" #include "qgraphicslayoutstyleinfo_p.h" +#include "qscopedpointer.h" #ifdef QT_DEBUG #include <QtCore/qdebug.h> #endif @@ -132,8 +133,7 @@ class QGraphicsLinearLayoutPrivate : public QGraphicsLayoutPrivate { public: QGraphicsLinearLayoutPrivate(Qt::Orientation orientation) - : orientation(orientation), - m_styleInfo(0) + : orientation(orientation) { } void removeGridItem(QGridLayoutItem *gridItem); @@ -143,7 +143,7 @@ public: int gridColumn(int index) const; Qt::Orientation orientation; - mutable QGraphicsLayoutStyleInfo *m_styleInfo; + mutable QScopedPointer<QGraphicsLayoutStyleInfo> m_styleInfo; QGraphicsGridLayoutEngine engine; }; @@ -178,8 +178,8 @@ int QGraphicsLinearLayoutPrivate::gridColumn(int index) const QGraphicsLayoutStyleInfo *QGraphicsLinearLayoutPrivate::styleInfo() const { if (!m_styleInfo) - m_styleInfo = new QGraphicsLayoutStyleInfo(this); - return m_styleInfo; + m_styleInfo.reset(new QGraphicsLayoutStyleInfo(this)); + return m_styleInfo.data(); } /*! diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 450d5a7d9c..fc5dbdd80a 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -3831,7 +3831,7 @@ QTransform QGraphicsView::transform() const } /*! - Returns a matrix that maps viewport coordinates to scene coordinates. + Returns a matrix that maps scene coordinates to viewport coordinates. \sa mapToScene(), mapFromScene() */ |