summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-02-09 15:22:03 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-03-21 14:00:29 +0000
commit6e8e9979d0786d7d730528c2888e0e1af4fb96ca (patch)
tree329bd13a96664cf3a238dde419d6335d55c1fc0f /src/corelib
parenta47cb146809e32f43449dcfe9932833c2f0ab987 (diff)
Make sure we can build with -no-feature-itemmodel
Various pieces of code have to be disabled in this case. Change-Id: I83b133f17e9f024016a79c9103293627185449d2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h1
-rw-r--r--src/corelib/itemmodels/itemmodels.pri48
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h2
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel_p.h2
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp5
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.h7
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel_p.h4
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.cpp5
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.h4
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel_p.h2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp5
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.h7
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.cpp4
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.h7
-rw-r--r--src/corelib/kernel/qmetatype.cpp9
-rw-r--r--src/corelib/kernel/qmetatype.h11
-rw-r--r--src/corelib/kernel/qmetatype_p.h2
-rw-r--r--src/corelib/kernel/qvariant.cpp56
-rw-r--r--src/corelib/kernel/qvariant.h14
20 files changed, 114 insertions, 83 deletions
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 86ef1a2613..3469ebe5e6 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -87,6 +87,7 @@
#define QT_FEATURE_journald -1
#define QT_FEATURE_futimens -1
#define QT_FEATURE_futimes -1
+#define QT_FEATURE_itemmodel -1
#define QT_FEATURE_library -1
#ifdef __linux__
# define QT_FEATURE_linkat 1
diff --git a/src/corelib/itemmodels/itemmodels.pri b/src/corelib/itemmodels/itemmodels.pri
index 83ec4c5dbf..068a8c4b3a 100644
--- a/src/corelib/itemmodels/itemmodels.pri
+++ b/src/corelib/itemmodels/itemmodels.pri
@@ -1,20 +1,46 @@
# Qt itemmodels core module
+!qtConfig(itemmodel): return()
+
HEADERS += \
itemmodels/qabstractitemmodel.h \
itemmodels/qabstractitemmodel_p.h \
- itemmodels/qabstractproxymodel.h \
- itemmodels/qabstractproxymodel_p.h \
itemmodels/qitemselectionmodel.h \
- itemmodels/qitemselectionmodel_p.h \
- itemmodels/qidentityproxymodel.h \
- itemmodels/qsortfilterproxymodel.h \
- itemmodels/qstringlistmodel.h
+ itemmodels/qitemselectionmodel_p.h
SOURCES += \
itemmodels/qabstractitemmodel.cpp \
- itemmodels/qabstractproxymodel.cpp \
- itemmodels/qitemselectionmodel.cpp \
- itemmodels/qidentityproxymodel.cpp \
- itemmodels/qsortfilterproxymodel.cpp \
- itemmodels/qstringlistmodel.cpp
+ itemmodels/qitemselectionmodel.cpp
+
+qtConfig(proxymodel) {
+ HEADERS += \
+ itemmodels/qabstractproxymodel.h \
+ itemmodels/qabstractproxymodel_p.h
+
+ SOURCES += \
+ itemmodels/qabstractproxymodel.cpp
+
+ qtConfig(identityproxymodel) {
+ HEADERS += \
+ itemmodels/qidentityproxymodel.h
+
+ SOURCES += \
+ itemmodels/qidentityproxymodel.cpp
+ }
+
+ qtConfig(sortfilterproxymodel) {
+ HEADERS += \
+ itemmodels/qsortfilterproxymodel.h
+
+ SOURCES += \
+ itemmodels/qsortfilterproxymodel.cpp
+ }
+}
+
+qtConfig(stringlistmodel) {
+ HEADERS += \
+ itemmodels/qstringlistmodel.h
+
+ SOURCES += \
+ itemmodels/qstringlistmodel.cpp
+}
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index fca21b9bbc..21171124f9 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -45,6 +45,8 @@
#include <QtCore/qhash.h>
#include <QtCore/qvector.h>
+QT_REQUIRE_CONFIG(itemmodel);
+
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/itemmodels/qabstractitemmodel_p.h b/src/corelib/itemmodels/qabstractitemmodel_p.h
index 7086ae730a..12fd93d217 100644
--- a/src/corelib/itemmodels/qabstractitemmodel_p.h
+++ b/src/corelib/itemmodels/qabstractitemmodel_p.h
@@ -60,6 +60,8 @@
QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(itemmodel);
+
class QPersistentModelIndexData
{
public:
diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp
index 39bfdd7782..b7c49a53e4 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.cpp
+++ b/src/corelib/itemmodels/qabstractproxymodel.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qabstractproxymodel.h"
-
-#ifndef QT_NO_PROXYMODEL
-
#include "qitemselectionmodel.h"
#include <private/qabstractproxymodel_p.h>
#include <QtCore/QSize>
@@ -471,5 +468,3 @@ Qt::DropActions QAbstractProxyModel::supportedDropActions() const
QT_END_NAMESPACE
#include "moc_qabstractproxymodel.cpp"
-
-#endif // QT_NO_PROXYMODEL
diff --git a/src/corelib/itemmodels/qabstractproxymodel.h b/src/corelib/itemmodels/qabstractproxymodel.h
index 6aa82b21ee..c4e5d67908 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.h
+++ b/src/corelib/itemmodels/qabstractproxymodel.h
@@ -42,10 +42,9 @@
#include <QtCore/qabstractitemmodel.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(proxymodel);
-#ifndef QT_NO_PROXYMODEL
+QT_BEGIN_NAMESPACE
class QAbstractProxyModelPrivate;
class QItemSelection;
@@ -112,8 +111,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_sourceModelDestroyed())
};
-#endif // QT_NO_PROXYMODEL
-
QT_END_NAMESPACE
#endif // QABSTRACTPROXYMODEL_H
diff --git a/src/corelib/itemmodels/qabstractproxymodel_p.h b/src/corelib/itemmodels/qabstractproxymodel_p.h
index 929bf1eb75..3a9f33baba 100644
--- a/src/corelib/itemmodels/qabstractproxymodel_p.h
+++ b/src/corelib/itemmodels/qabstractproxymodel_p.h
@@ -54,7 +54,7 @@
#include "private/qabstractitemmodel_p.h"
-#ifndef QT_NO_PROXYMODEL
+QT_REQUIRE_CONFIG(proxymodel);
QT_BEGIN_NAMESPACE
@@ -71,6 +71,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PROXYMODEL
-
#endif // QABSTRACTPROXYMODEL_P_H
diff --git a/src/corelib/itemmodels/qidentityproxymodel.cpp b/src/corelib/itemmodels/qidentityproxymodel.cpp
index 7c306799d0..e984ec194e 100644
--- a/src/corelib/itemmodels/qidentityproxymodel.cpp
+++ b/src/corelib/itemmodels/qidentityproxymodel.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qidentityproxymodel.h"
-
-#ifndef QT_NO_IDENTITYPROXYMODEL
-
#include "qitemselectionmodel.h"
#include <private/qabstractproxymodel_p.h>
@@ -616,5 +613,3 @@ void QIdentityProxyModelPrivate::_q_sourceRowsRemoved(const QModelIndex &parent,
QT_END_NAMESPACE
#include "moc_qidentityproxymodel.cpp"
-
-#endif // QT_NO_IDENTITYPROXYMODEL
diff --git a/src/corelib/itemmodels/qidentityproxymodel.h b/src/corelib/itemmodels/qidentityproxymodel.h
index d2b1ed9498..3e6f5e4c48 100644
--- a/src/corelib/itemmodels/qidentityproxymodel.h
+++ b/src/corelib/itemmodels/qidentityproxymodel.h
@@ -43,7 +43,7 @@
#include <QtCore/qabstractproxymodel.h>
-#ifndef QT_NO_IDENTITYPROXYMODEL
+QT_REQUIRE_CONFIG(identityproxymodel);
QT_BEGIN_NAMESPACE
@@ -110,7 +110,5 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_IDENTITYPROXYMODEL
-
#endif // QIDENTITYPROXYMODEL_H
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 091c5a21a5..63e5f0ca9c 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -47,6 +47,8 @@
#include <QtCore/qlist.h>
#include <QtCore/qabstractitemmodel.h>
+QT_REQUIRE_CONFIG(itemmodel);
+
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QItemSelectionRange
diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h
index dfc0387563..187d4a2c1d 100644
--- a/src/corelib/itemmodels/qitemselectionmodel_p.h
+++ b/src/corelib/itemmodels/qitemselectionmodel_p.h
@@ -53,6 +53,8 @@
#include "private/qobject_p.h"
+QT_REQUIRE_CONFIG(itemmodel);
+
QT_BEGIN_NAMESPACE
class QItemSelectionModelPrivate: public QObjectPrivate
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 220c6be79e..78093727b8 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qsortfilterproxymodel.h"
-
-#ifndef QT_NO_SORTFILTERPROXYMODEL
-
#include "qitemselectionmodel.h"
#include <qsize.h>
#include <qdebug.h>
@@ -2883,5 +2880,3 @@ QItemSelection QSortFilterProxyModel::mapSelectionFromSource(const QItemSelectio
QT_END_NAMESPACE
#include "moc_qsortfilterproxymodel.cpp"
-
-#endif // QT_NO_SORTFILTERPROXYMODEL
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h
index 196dab2770..907ceb8e6d 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.h
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.h
@@ -41,11 +41,10 @@
#define QSORTFILTERPROXYMODEL_H
#include <QtCore/qabstractproxymodel.h>
-
-#ifndef QT_NO_SORTFILTERPROXYMODEL
-
#include <QtCore/qregexp.h>
+QT_REQUIRE_CONFIG(sortfilterproxymodel);
+
QT_BEGIN_NAMESPACE
@@ -198,6 +197,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_SORTFILTERPROXYMODEL
-
#endif // QSORTFILTERPROXYMODEL_H
diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp
index bcfd88fb19..567e6fa35e 100644
--- a/src/corelib/itemmodels/qstringlistmodel.cpp
+++ b/src/corelib/itemmodels/qstringlistmodel.cpp
@@ -47,8 +47,6 @@
#include <algorithm>
-#ifndef QT_NO_STRINGLISTMODEL
-
QT_BEGIN_NAMESPACE
/*!
@@ -329,5 +327,3 @@ Qt::DropActions QStringListModel::supportedDropActions() const
QT_END_NAMESPACE
#include "moc_qstringlistmodel.cpp"
-
-#endif // QT_NO_STRINGLISTMODEL
diff --git a/src/corelib/itemmodels/qstringlistmodel.h b/src/corelib/itemmodels/qstringlistmodel.h
index 38da1022ea..a40c13ae40 100644
--- a/src/corelib/itemmodels/qstringlistmodel.h
+++ b/src/corelib/itemmodels/qstringlistmodel.h
@@ -43,10 +43,9 @@
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qstringlist.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(stringlistmodel);
-#ifndef QT_NO_STRINGLISTMODEL
+QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QStringListModel : public QAbstractListModel
{
@@ -78,8 +77,6 @@ private:
QStringList lst;
};
-#endif // QT_NO_STRINGLISTMODEL
-
QT_END_NAMESPACE
#endif // QSTRINGLISTMODEL_H
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 518381712a..fc40668c9a 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -61,7 +61,6 @@
# include "qbitarray.h"
# include "qurl.h"
# include "qvariant.h"
-# include "qabstractitemmodel.h"
# include "qjsonvalue.h"
# include "qjsonobject.h"
# include "qjsonarray.h"
@@ -69,6 +68,10 @@
# include "qbytearraylist.h"
#endif
+#if QT_CONFIG(itemmodel)
+# include "qabstractitemmodel.h"
+#endif
+
#ifndef QT_NO_GEOM_VARIANT
# include "qsize.h"
# include "qpoint.h"
@@ -1349,8 +1352,10 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
case QMetaType::Void:
case QMetaType::VoidStar:
case QMetaType::QObjectStar:
+#if QT_CONFIG(itemmodel)
case QMetaType::QModelIndex:
case QMetaType::QPersistentModelIndex:
+#endif
case QMetaType::QJsonValue:
case QMetaType::QJsonObject:
case QMetaType::QJsonArray:
@@ -1573,8 +1578,10 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
case QMetaType::Void:
case QMetaType::VoidStar:
case QMetaType::QObjectStar:
+#if QT_CONFIG(itemmodel)
case QMetaType::QModelIndex:
case QMetaType::QPersistentModelIndex:
+#endif
case QMetaType::QJsonValue:
case QMetaType::QJsonObject:
case QMetaType::QJsonArray:
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 4674efe568..a0969ee908 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -89,6 +89,14 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId();
#define QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(F)\
F(VoidStar, 31, void*) \
+#if QT_CONFIG(itemmodel)
+#define QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)\
+ F(QModelIndex, 42, QModelIndex) \
+ F(QPersistentModelIndex, 50, QPersistentModelIndex)
+#else
+#define QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)
+#endif
+
#define QT_FOR_EACH_STATIC_CORE_CLASS(F)\
F(QChar, 7, QChar) \
F(QString, 10, QString) \
@@ -112,13 +120,12 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId();
F(QEasingCurve, 29, QEasingCurve) \
F(QUuid, 30, QUuid) \
F(QVariant, 41, QVariant) \
- F(QModelIndex, 42, QModelIndex) \
F(QRegularExpression, 44, QRegularExpression) \
F(QJsonValue, 45, QJsonValue) \
F(QJsonObject, 46, QJsonObject) \
F(QJsonArray, 47, QJsonArray) \
F(QJsonDocument, 48, QJsonDocument) \
- F(QPersistentModelIndex, 50, QPersistentModelIndex) \
+ QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)
#define QT_FOR_EACH_STATIC_CORE_POINTER(F)\
F(QObjectStar, 39, QObject*)
diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h
index 0bf6bcb922..cef20a5d12 100644
--- a/src/corelib/kernel/qmetatype_p.h
+++ b/src/corelib/kernel/qmetatype_p.h
@@ -201,8 +201,6 @@ template<> struct TypeDefinition<QJsonArray> { static const bool IsAvailable = f
template<> struct TypeDefinition<QJsonDocument> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QJsonObject> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QJsonValue> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QModelIndex> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QPersistentModelIndex> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QUrl> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QByteArrayList> { static const bool IsAvailable = false; };
#endif
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index c3c36e05d7..b3a86576af 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -56,8 +56,10 @@
#include "qurl.h"
#include "qlocale.h"
#include "quuid.h"
-#ifndef QT_BOOTSTRAPPED
+#if QT_CONFIG(itemmodel)
#include "qabstractitemmodel.h"
+#endif
+#ifndef QT_BOOTSTRAPPED
#include "qjsonvalue.h"
#include "qjsonobject.h"
#include "qjsonarray.h"
@@ -393,6 +395,8 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
return false;
}
break;
+#endif // QT_BOOTSTRAPPED
+#if QT_CONFIG(itemmodel)
case QVariant::ModelIndex:
switch (d->type) {
case QVariant::PersistentModelIndex:
@@ -411,7 +415,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
return false;
}
break;
-#endif // QT_BOOTSTRAPPED
+#endif // QT_CONFIG(itemmodel)
case QVariant::String: {
QString *str = static_cast<QString *>(result);
switch (d->type) {
@@ -1952,12 +1956,6 @@ QVariant::QVariant(const QRegularExpression &re)
QVariant::QVariant(const QUuid &uuid)
: d(Uuid)
{ v_construct<QUuid>(&d, uuid); }
-QVariant::QVariant(const QModelIndex &modelIndex)
- : d(ModelIndex)
-{ v_construct<QModelIndex>(&d, modelIndex); }
-QVariant::QVariant(const QPersistentModelIndex &modelIndex)
- : d(PersistentModelIndex)
-{ v_construct<QPersistentModelIndex>(&d, modelIndex); }
QVariant::QVariant(const QJsonValue &jsonValue)
: d(QMetaType::QJsonValue)
{ v_construct<QJsonValue>(&d, jsonValue); }
@@ -1971,6 +1969,14 @@ QVariant::QVariant(const QJsonDocument &jsonDocument)
: d(QMetaType::QJsonDocument)
{ v_construct<QJsonDocument>(&d, jsonDocument); }
#endif // QT_BOOTSTRAPPED
+#if QT_CONFIG(itemmodel)
+QVariant::QVariant(const QModelIndex &modelIndex)
+ : d(ModelIndex)
+{ v_construct<QModelIndex>(&d, modelIndex); }
+QVariant::QVariant(const QPersistentModelIndex &modelIndex)
+ : d(PersistentModelIndex)
+{ v_construct<QPersistentModelIndex>(&d, modelIndex); }
+#endif
/*!
Returns the storage type of the value stored in the variant.
@@ -2668,21 +2674,7 @@ QRegularExpression QVariant::toRegularExpression() const
}
#endif // QT_CONFIG(regularexpression)
-#ifndef QT_BOOTSTRAPPED
-/*!
- \since 5.0
-
- Returns the variant as a QUuid if the variant has type()
- \l QMetaType::QUuid, \l QMetaType::QByteArray or \l QMetaType::QString;
- otherwise returns a default-constructed QUuid.
-
- \sa canConvert(), convert()
-*/
-QUuid QVariant::toUuid() const
-{
- return qVariantToHelper<QUuid>(d, handlerManager);
-}
-
+#if QT_CONFIG(itemmodel)
/*!
\since 5.0
@@ -2708,6 +2700,22 @@ QPersistentModelIndex QVariant::toPersistentModelIndex() const
{
return qVariantToHelper<QPersistentModelIndex>(d, handlerManager);
}
+#endif // QT_CONFIG(itemmodel)
+
+#ifndef QT_BOOTSTRAPPED
+/*!
+ \since 5.0
+
+ Returns the variant as a QUuid if the variant has type()
+ \l QMetaType::QUuid, \l QMetaType::QByteArray or \l QMetaType::QString;
+ otherwise returns a default-constructed QUuid.
+
+ \sa canConvert(), convert()
+*/
+QUuid QVariant::toUuid() const
+{
+ return qVariantToHelper<QUuid>(d, handlerManager);
+}
/*!
\since 5.0
@@ -3182,9 +3190,11 @@ bool QVariant::canConvert(int targetTypeId) const
if (d.type == targetTypeId)
return true;
+#if QT_CONFIG(itemmodel)
if ((targetTypeId == QMetaType::QModelIndex && d.type == QMetaType::QPersistentModelIndex)
|| (targetTypeId == QMetaType::QPersistentModelIndex && d.type == QMetaType::QModelIndex))
return true;
+#endif
if (targetTypeId == QMetaType::QVariantList
&& (d.type == QMetaType::QVariantList
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 361768ef00..9a5fc63d03 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -165,8 +165,10 @@ class Q_CORE_EXPORT QVariant
Hash = QMetaType::QVariantHash,
EasingCurve = QMetaType::QEasingCurve,
Uuid = QMetaType::QUuid,
+#if QT_CONFIG(itemmodel)
ModelIndex = QMetaType::QModelIndex,
PersistentModelIndex = QMetaType::QPersistentModelIndex,
+#endif
LastCoreType = QMetaType::LastCoreType,
Font = QMetaType::QFont,
@@ -255,13 +257,15 @@ class Q_CORE_EXPORT QVariant
QVariant(const QUrl &url);
QVariant(const QEasingCurve &easing);
QVariant(const QUuid &uuid);
- QVariant(const QModelIndex &modelIndex);
- QVariant(const QPersistentModelIndex &modelIndex);
QVariant(const QJsonValue &jsonValue);
QVariant(const QJsonObject &jsonObject);
QVariant(const QJsonArray &jsonArray);
QVariant(const QJsonDocument &jsonDocument);
#endif // QT_BOOTSTRAPPED
+#if QT_CONFIG(itemmodel)
+ QVariant(const QModelIndex &modelIndex);
+ QVariant(const QPersistentModelIndex &modelIndex);
+#endif
QVariant& operator=(const QVariant &other);
#ifdef Q_COMPILER_RVALUE_REFS
@@ -329,13 +333,15 @@ class Q_CORE_EXPORT QVariant
QUrl toUrl() const;
QEasingCurve toEasingCurve() const;
QUuid toUuid() const;
- QModelIndex toModelIndex() const;
- QPersistentModelIndex toPersistentModelIndex() const;
QJsonValue toJsonValue() const;
QJsonObject toJsonObject() const;
QJsonArray toJsonArray() const;
QJsonDocument toJsonDocument() const;
#endif // QT_BOOTSTRAPPED
+#if QT_CONFIG(itemmodel)
+ QModelIndex toModelIndex() const;
+ QPersistentModelIndex toPersistentModelIndex() const;
+#endif
#ifndef QT_NO_DATASTREAM
void load(QDataStream &ds);