summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-10-08 11:55:13 +0200
committerLars Knoll <lars.knoll@qt.io>2018-12-03 17:57:03 +0000
commit972f8845a85d6a07140025e4257cb8a1a2699b5d (patch)
tree09c393bcbd6f38256e54cd4bd0b7f90e4029ec33 /src/corelib/tools/qlist.cpp
parent4b1ce72c232b21fb1a8ae8ca86c2b8a7bc00b993 (diff)
Invert include dependencies between QList and QVector
This is a very slight source incompatibility, but required as a preparation for Qt 6, where QList should inherit QVector or share the implementation with it. This requires some special work to correctly instantiate and export QVector<QPoint> from Qt Core on MSVC. Change-Id: I1d042c5fafdde7afe59409eda2580871d4832fcd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qlist.cpp')
-rw-r--r--src/corelib/tools/qlist.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 17aba8035b..0eed4a619e 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -48,6 +48,23 @@
QT_BEGIN_NAMESPACE
/*
+ ### Qt 5:
+ ### This needs to be removed for next releases of Qt. It is a workaround for vc++ because
+ ### Qt exports QPolygon and QPolygonF that inherit QVector<QPoint> and
+ ### QVector<QPointF> respectively.
+*/
+
+#if defined(Q_CC_MSVC) && defined(QT_BUILD_CORE_LIB)
+QT_BEGIN_INCLUDE_NAMESPACE
+#include <QtCore/qpoint.h>
+QT_END_INCLUDE_NAMESPACE
+
+template class Q_CORE_EXPORT QVector<QPointF>;
+template class Q_CORE_EXPORT QVector<QPoint>;
+#endif
+
+
+/*
QList as an array-list combines the easy-of-use of a random
access interface with fast list operations and the low memory
management overhead of an array. Accessing elements by index,