summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-12-16 12:48:18 -0800
committerJani Heikkinen <jani.heikkinen@qt.io>2017-01-03 15:01:32 +0000
commit39e80062d0cf0c25b456bd89be827e50a6077efa (patch)
tree9030b766fdf474239af57c2c9f2be39fe819117a /src/corelib/itemmodels
parentf55db6738bb5a14ba6ebcfe840225fe9d2ae98c2 (diff)
Work around MSVC ABI stupidity in exporting inline members of base class
In this case, the issue was ICC, when compiling QtQml: qv4sequenceobject.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QList<class QItemSelectionRange>::replace(int,class QItemSelectionRange const &)" (__imp_?replace@?$QList@VQItemSelectionRange@@@@QEAAXHAEBVQItemSelectionRange@@@Z) referenced in function "public: static bool __cdecl QV4::QQmlSequence<class QItemSelection>::deleteIndexedProperty(struct QV4::Managed *,unsigned int)" (?deleteIndexedProperty@?$QQmlSequence@VQItemSelection@@@QV4@@SA_NPEAUManaged@2@I@Z) This applies the same fix as qvector.h has had for ages due to QPolygon. Change-Id: I15b62e0f9cec482fbb40fffd1490d791db5056bc Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 3d3cb00750..c22ac6dbe5 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -251,6 +251,24 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QItemSelectionModel::SelectionFlags)
// dummy implentation of qHash() necessary for instantiating QList<QItemSelectionRange>::toSet() with MSVC
inline uint qHash(const QItemSelectionRange &) { return 0; }
+#ifdef Q_CC_MSVC
+
+/*
+ ### Qt 6:
+ ### This needs to be removed for next releases of Qt. It is a workaround for vc++ because
+ ### Qt exports QItemSelection that inherits QList<QItemSelectionRange>.
+*/
+
+# ifndef Q_TEMPLATE_EXTERN
+# if defined(QT_BUILD_CORE_LIB)
+# define Q_TEMPLATE_EXTERN
+# else
+# define Q_TEMPLATE_EXTERN extern
+# endif
+# endif
+Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QList<QItemSelectionRange>;
+#endif // Q_CC_MSVC
+
class Q_CORE_EXPORT QItemSelection : public QList<QItemSelectionRange>
{
public: