diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-11-15 10:08:20 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-29 10:37:13 +0100 |
commit | 8cc5e5ecd7ebea89a6a4c2f931d6774255911df7 (patch) | |
tree | 5f62d63c6799242e5777ff2d133df9042fc2a182 /src/layouts | |
parent | fad829ff7ab42b91c611f458ea48b75094f2e082 (diff) |
Prepare to move the gridlayout engine so it can be shared.
Currently, the gridlayout engine is duplicated in QtQuick.Layouts module
and in QtWidgets module.
The plan is to move the gridlayout engine from QtWidgets to QtGui and
export it privately from there. However, that would produce linkage
errors when linking the QtQuick.Layouts module.
As a temporary solution we put the gridlayout engine in a namespace
until the move has been completed.
Change-Id: I8b43583cadff8846b5ed275f7fb5614737d903ad
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/layouts')
-rw-r--r-- | src/layouts/qgridlayoutengine.cpp | 4 | ||||
-rw-r--r-- | src/layouts/qgridlayoutengine_p.h | 5 | ||||
-rw-r--r-- | src/layouts/qlayoutpolicy.cpp | 4 | ||||
-rw-r--r-- | src/layouts/qlayoutpolicy_p.h | 4 | ||||
-rw-r--r-- | src/layouts/qquickgridlayoutengine.cpp | 2 | ||||
-rw-r--r-- | src/layouts/qquickgridlayoutengine_p.h | 1 |
6 files changed, 20 insertions, 0 deletions
diff --git a/src/layouts/qgridlayoutengine.cpp b/src/layouts/qgridlayoutengine.cpp index 910e34a0e..190222140 100644 --- a/src/layouts/qgridlayoutengine.cpp +++ b/src/layouts/qgridlayoutengine.cpp @@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE +namespace LayoutEngineInQtQuickLayouts { + template <typename T> static void insertOrRemoveItems(QVector<T> &items, int index, int delta) { @@ -1682,6 +1684,8 @@ void QGridLayoutEngine::ensureGeometries(const QSizeF &size, } } +} // namespace LayoutEngineInQtQuickLayouts + QT_END_NAMESPACE #endif //QT_NO_GRAPHICSVIEW diff --git a/src/layouts/qgridlayoutengine_p.h b/src/layouts/qgridlayoutengine_p.h index a1a874cf8..87c2d234e 100644 --- a/src/layouts/qgridlayoutengine_p.h +++ b/src/layouts/qgridlayoutengine_p.h @@ -71,6 +71,9 @@ class QStyle; class QWidget; class QStyleOption; + +namespace LayoutEngineInQtQuickLayouts { + // ### FIX THIS GUY class QLayoutStyleInfo { @@ -555,6 +558,8 @@ public: friend class QGridLayoutItem; }; +} // namespace LayoutEngineInQtQuickLayouts + QT_END_NAMESPACE #endif diff --git a/src/layouts/qlayoutpolicy.cpp b/src/layouts/qlayoutpolicy.cpp index 9a154768e..4c31c29a5 100644 --- a/src/layouts/qlayoutpolicy.cpp +++ b/src/layouts/qlayoutpolicy.cpp @@ -45,6 +45,8 @@ QT_BEGIN_NAMESPACE +namespace LayoutEngineInQtQuickLayouts { + void QLayoutPolicy::setControlType(ControlType type) { /* @@ -133,4 +135,6 @@ QDebug operator<<(QDebug dbg, const QLayoutPolicy &p) } #endif +} // namespace LayoutEngineInQtQuickLayouts + QT_END_NAMESPACE diff --git a/src/layouts/qlayoutpolicy_p.h b/src/layouts/qlayoutpolicy_p.h index 0f3e6a081..ea9f48646 100644 --- a/src/layouts/qlayoutpolicy_p.h +++ b/src/layouts/qlayoutpolicy_p.h @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE class QVariant; +namespace LayoutEngineInQtQuickLayouts { + class QLayoutPolicy { Q_ENUMS(Policy) @@ -175,6 +177,8 @@ inline void QLayoutPolicy::transpose() { setVerticalStretch(hStretch); } +} // namespace LayoutEngineInQtQuickLayouts + QT_END_NAMESPACE #endif // QLAYOUTPOLICY_H diff --git a/src/layouts/qquickgridlayoutengine.cpp b/src/layouts/qquickgridlayoutengine.cpp index 419a81df7..3c38e1876 100644 --- a/src/layouts/qquickgridlayoutengine.cpp +++ b/src/layouts/qquickgridlayoutengine.cpp @@ -45,6 +45,8 @@ QT_BEGIN_NAMESPACE +using namespace LayoutEngineInQtQuickLayouts; + /* The layout engine assumes: 1. minimum <= preferred <= maximum diff --git a/src/layouts/qquickgridlayoutengine_p.h b/src/layouts/qquickgridlayoutengine_p.h index 6eba922ce..56fe888ea 100644 --- a/src/layouts/qquickgridlayoutengine_p.h +++ b/src/layouts/qquickgridlayoutengine_p.h @@ -59,6 +59,7 @@ #include "qdebug.h" QT_BEGIN_NAMESPACE +using namespace LayoutEngineInQtQuickLayouts; class QQuickGridLayoutItem : public QGridLayoutItem { public: |