summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-11-15 10:08:20 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-29 10:37:13 +0100
commit8cc5e5ecd7ebea89a6a4c2f931d6774255911df7 (patch)
tree5f62d63c6799242e5777ff2d133df9042fc2a182
parentfad829ff7ab42b91c611f458ea48b75094f2e082 (diff)
downloadqtquickcontrols-8cc5e5ecd7ebea89a6a4c2f931d6774255911df7.tar.gz
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>
-rw-r--r--src/layouts/qgridlayoutengine.cpp4
-rw-r--r--src/layouts/qgridlayoutengine_p.h5
-rw-r--r--src/layouts/qlayoutpolicy.cpp4
-rw-r--r--src/layouts/qlayoutpolicy_p.h4
-rw-r--r--src/layouts/qquickgridlayoutengine.cpp2
-rw-r--r--src/layouts/qquickgridlayoutengine_p.h1
6 files changed, 20 insertions, 0 deletions
diff --git a/src/layouts/qgridlayoutengine.cpp b/src/layouts/qgridlayoutengine.cpp
index 910e34a0..19022214 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 a1a874cf..87c2d234 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 9a154768..4c31c29a 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 0f3e6a08..ea9f4864 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 419a81df..3c38e187 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 6eba922c..56fe888e 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: