diff options
Diffstat (limited to 'src')
107 files changed, 867 insertions, 253 deletions
diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro index 7682e7b075..907fbe9273 100644 --- a/src/plugins/qmltooling/qmltooling.pro +++ b/src/plugins/qmltooling/qmltooling.pro @@ -1,32 +1,35 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += qml -!no_network { - # Utilities - SUBDIRS += \ - packetprotocol +# Utilities +SUBDIRS += \ + packetprotocol + +# Connectors +SUBDIRS += \ + qmldbg_native \ + qmldbg_server - # Connectors +qtConfig(qml-network) { SUBDIRS += \ - qmldbg_native \ - qmldbg_server \ qmldbg_local \ qmldbg_tcp +} - # Services - SUBDIRS += \ - qmldbg_debugger \ - qmldbg_profiler +# Services +SUBDIRS += \ + qmldbg_debugger \ + qmldbg_profiler - qmldbg_server.depends = packetprotocol - qmldbg_native.depends = packetprotocol - qmldbg_debugger.depends = packetprotocol - qmldbg_profiler.depends = packetprotocol +qmldbg_server.depends = packetprotocol +qmldbg_native.depends = packetprotocol +qmldbg_debugger.depends = packetprotocol +qmldbg_profiler.depends = packetprotocol - qtHaveModule(quick) { - SUBDIRS += \ - qmldbg_inspector \ - qmldbg_quickprofiler - qmldbg_inspector.depends = packetprotocol - qmldbg_quickprofiler.depends = packetprotocol - } +qtHaveModule(quick) { + SUBDIRS += \ + qmldbg_inspector \ + qmldbg_quickprofiler + qmldbg_inspector.depends = packetprotocol + qmldbg_quickprofiler.depends = packetprotocol } diff --git a/src/qml/compiler/compiler.pri b/src/qml/compiler/compiler.pri index e49f5c40a5..a63de67b4c 100644 --- a/src/qml/compiler/compiler.pri +++ b/src/qml/compiler/compiler.pri @@ -25,8 +25,6 @@ SOURCES += \ HEADERS += \ $$PWD/qqmltypecompiler_p.h \ - $$PWD/qv4isel_moth_p.h \ - $$PWD/qv4instr_moth_p.h \ $$PWD/qqmlpropertycachecreator_p.h \ $$PWD/qqmlpropertyvalidator_p.h \ $$PWD/qv4compilationunitmapper_p.h @@ -34,8 +32,6 @@ HEADERS += \ SOURCES += \ $$PWD/qqmltypecompiler.cpp \ - $$PWD/qv4instr_moth.cpp \ - $$PWD/qv4isel_moth.cpp \ $$PWD/qqmlpropertycachecreator.cpp \ $$PWD/qqmlpropertyvalidator.cpp \ $$PWD/qv4compilationunitmapper.cpp @@ -43,4 +39,14 @@ SOURCES += \ unix: SOURCES += $$PWD/qv4compilationunitmapper_unix.cpp else: SOURCES += $$PWD/qv4compilationunitmapper_win.cpp +qtConfig(qml-interpreter) { + HEADERS += \ + $$PWD/qv4instr_moth_p.h \ + $$PWD/qv4isel_moth_p.h + SOURCES += \ + $$PWD/qv4instr_moth.cpp \ + $$PWD/qv4isel_moth.cpp +} + + } diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index beb43376ee..b83bcdb83b 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -50,12 +50,13 @@ // // We mean it. // - -#include <QtCore/qglobal.h> +#include <private/qv4global_p.h> #include <private/qv4value_p.h> #include <private/qv4function_p.h> #include <private/qv4runtime_p.h> +QT_REQUIRE_CONFIG(qml_interpreter); + QT_BEGIN_NAMESPACE #ifdef QT_NO_QML_DEBUGGER diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index c304284cbc..74323a2912 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -58,6 +58,8 @@ #include <private/qv4value_p.h> #include "qv4instr_moth_p.h" +QT_REQUIRE_CONFIG(qml_interpreter); + QT_BEGIN_NAMESPACE namespace QV4 { diff --git a/src/qml/configure.json b/src/qml/configure.json new file mode 100644 index 0000000000..d22ba3b8f0 --- /dev/null +++ b/src/qml/configure.json @@ -0,0 +1,37 @@ +{ + "module": "qml", + "depends": [ + "core-private", + "network-private" + ], + + "commandline": { + "options": { + "qml-interpreter": "boolean", + "qml-network": "boolean" + } + }, + + "features": { + "qml-interpreter": { + "label": "QML interpreter", + "purpose": "Support for the QML interpreter", + "output": [ "privateFeature" ] + }, + "qml-network": { + "label": "QML network support", + "purpose": "Provides network transparency for QML", + "output": [ "publicFeature" ] + } + }, + + "summary": [ + { + "section": "Qt QML", + "entries": [ + "qml-interpreter", + "qml-network" + ] + } + ] +} diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri index e72b06359e..dcc04cbd54 100644 --- a/src/qml/jsruntime/jsruntime.pri +++ b/src/qml/jsruntime/jsruntime.pri @@ -38,7 +38,6 @@ SOURCES += \ $$PWD/qv4sequenceobject.cpp \ $$PWD/qv4include.cpp \ $$PWD/qv4qobjectwrapper.cpp \ - $$PWD/qv4vme_moth.cpp \ $$PWD/qv4arraybuffer.cpp \ $$PWD/qv4typedarray.cpp \ $$PWD/qv4dataview.cpp @@ -88,12 +87,18 @@ HEADERS += \ $$PWD/qv4sequenceobject_p.h \ $$PWD/qv4include_p.h \ $$PWD/qv4qobjectwrapper_p.h \ - $$PWD/qv4vme_moth_p.h \ $$PWD/qv4profiling_p.h \ $$PWD/qv4arraybuffer_p.h \ $$PWD/qv4typedarray_p.h \ $$PWD/qv4dataview_p.h +qtConfig(qml-interpreter) { + HEADERS += \ + $$PWD/qv4vme_moth_p.h + SOURCES += \ + $$PWD/qv4vme_moth.cpp +} + } diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index f630dfaee0..a9284f2e69 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -86,7 +86,9 @@ #include "qv4isel_masm_p.h" #endif // V4_ENABLE_JIT +#if QT_CONFIG(qml_interpreter) #include "qv4isel_moth_p.h" +#endif #if USE(PTHREADS) # include <pthread.h> @@ -160,6 +162,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) MemoryManager::GCBlocker gcBlocker(memoryManager); if (!factory) { +#if QT_CONFIG(qml_interpreter) bool jitDisabled = true; #ifdef V4_ENABLE_JIT @@ -180,6 +183,9 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) "very slow. Visit https://wiki.qt.io/V4 to learn about possible " "solutions for your platform."); } +#else + factory = new JIT::ISelFactory; +#endif } iselFactory.reset(factory); diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index c33d2cad11..be8057e9f5 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -41,7 +41,7 @@ #include "qv4scopedvalue_p.h" #include <QtQml/qjsengine.h> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include <QtNetwork/qnetworkrequest.h> #include <QtNetwork/qnetworkreply.h> #endif @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE QV4Include::QV4Include(const QUrl &url, QV4::ExecutionEngine *engine, QV4::QmlContext *qmlContext, const QV4::Value &callback) : v4(engine), m_url(url) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) , m_redirectCount(0), m_network(0) , m_reply(0) #endif { @@ -71,7 +71,7 @@ QV4Include::QV4Include(const QUrl &url, QV4::ExecutionEngine *engine, m_resultObject.set(v4, resultValue(v4)); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) m_network = engine->v8Engine->networkAccessManager(); QNetworkRequest request; @@ -86,7 +86,7 @@ QV4Include::QV4Include(const QUrl &url, QV4::ExecutionEngine *engine, QV4Include::~QV4Include() { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) delete m_reply; m_reply = 0; #endif @@ -135,7 +135,7 @@ QV4::ReturnedValue QV4Include::result() #define INCLUDE_MAXIMUM_REDIRECT_RECURSION 15 void QV4Include::finished() { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) m_redirectCount++; if (m_redirectCount < INCLUDE_MAXIMUM_REDIRECT_RECURSION) { @@ -184,7 +184,7 @@ void QV4Include::finished() QV4::ScopedObject resultObj(scope, m_resultObject.value()); QV4::ScopedString status(scope, v4->newString(QStringLiteral("status"))); resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(NetworkError))); -#endif //QT_NO_NETWORK +#endif // qml_network QV4::ScopedValue cb(scope, m_callbackFunction.value()); callback(cb, resultObj); @@ -211,7 +211,7 @@ QV4::ReturnedValue QV4Include::method_include(QV4::CallContext *ctx) if (ctx->argc() >= 2 && ctx->args()[1].as<QV4::FunctionObject>()) callbackFunction = ctx->args()[1]; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QUrl url(scope.engine->resolvedUrl(ctx->args()[0].toQStringNoThrow())); if (scope.engine->qmlEngine() && scope.engine->qmlEngine()->urlInterceptor()) url = scope.engine->qmlEngine()->urlInterceptor()->intercept(url, QQmlAbstractUrlInterceptor::JavaScriptFile); diff --git a/src/qml/jsruntime/qv4include_p.h b/src/qml/jsruntime/qv4include_p.h index 1750e6a7e1..4c601a5e7b 100644 --- a/src/qml/jsruntime/qv4include_p.h +++ b/src/qml/jsruntime/qv4include_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE class QQmlEngine; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) class QNetworkAccessManager; #endif class QNetworkReply; @@ -94,7 +94,7 @@ private: QV4::ExecutionEngine *v4; QUrl m_url; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) int m_redirectCount; QNetworkAccessManager *m_network; QPointer<QNetworkReply> m_reply; diff --git a/src/qml/jsruntime/qv4vme_moth_p.h b/src/qml/jsruntime/qv4vme_moth_p.h index cd8d335f1c..f8893509d9 100644 --- a/src/qml/jsruntime/qv4vme_moth_p.h +++ b/src/qml/jsruntime/qv4vme_moth_p.h @@ -51,9 +51,12 @@ // We mean it. // +#include <private/qv4global_p.h> #include <private/qv4runtime_p.h> #include <private/qv4instr_moth_p.h> +QT_REQUIRE_CONFIG(qml_interpreter); + QT_BEGIN_NAMESPACE namespace QV4 { diff --git a/src/qml/qml.pro b/src/qml/qml.pro index 13e00d8812..84c3f04349 100644 --- a/src/qml/qml.pro +++ b/src/qml/qml.pro @@ -1,11 +1,8 @@ TARGET = QtQml QT = core-private -no_network { - DEFINES += QT_NO_NETWORK -} else { +qtConfig(qml-network): \ QT += network -} DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index cb51c18925..c10aa0129c 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -70,7 +70,7 @@ #include <QtCore/qthread.h> #include <private/qthread_p.h> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include "qqmlnetworkaccessmanagerfactory.h" #include <QNetworkAccessManager> #include <QtNetwork/qnetworkconfigmanager.h> @@ -646,7 +646,7 @@ QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e) cleanup(0), erroredBindings(0), inProgressCreations(0), workerScriptEngine(0), activeObjectCreator(0), -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) networkAccessManager(0), networkAccessManagerFactory(0), #endif urlInterceptor(0), scarceResourcesRefCount(0), importDatabase(e), typeLoader(e), @@ -1129,7 +1129,7 @@ void QQmlEnginePrivate::registerFinalizeCallback(QObject *obj, int index) } } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) /*! Sets the \a factory to use for creating QNetworkAccessManager(s). @@ -1196,7 +1196,7 @@ QNetworkAccessManager *QQmlEngine::networkAccessManager() const Q_D(const QQmlEngine); return d->getNetworkAccessManager(); } -#endif // QT_NO_NETWORK +#endif // qml_network /*! diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h index bbb9c36ce9..2c0c39d0b4 100644 --- a/src/qml/qml/qqmlengine.h +++ b/src/qml/qml/qqmlengine.h @@ -87,7 +87,7 @@ class QQmlExpression; class QQmlContext; class QQmlType; class QUrl; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) class QNetworkAccessManager; class QQmlNetworkAccessManagerFactory; #endif @@ -117,7 +117,7 @@ public: bool importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void setNetworkAccessManagerFactory(QQmlNetworkAccessManagerFactory *); QQmlNetworkAccessManagerFactory *networkAccessManagerFactory() const; diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h index 713b03dbf3..916566b6c7 100644 --- a/src/qml/qml/qqmlengine_p.h +++ b/src/qml/qml/qqmlengine_p.h @@ -162,7 +162,7 @@ public: void registerFinalizeCallback(QObject *obj, int index); QQmlObjectCreator *activeObjectCreator; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *createNetworkAccessManager(QObject *parent) const; QNetworkAccessManager *getNetworkAccessManager() const; mutable QNetworkAccessManager *networkAccessManager; diff --git a/src/qml/qml/qqmlfile.cpp b/src/qml/qml/qqmlfile.cpp index 4769402855..4e4db086b0 100644 --- a/src/qml/qml/qqmlfile.cpp +++ b/src/qml/qml/qqmlfile.cpp @@ -68,7 +68,7 @@ static char assets_string[] = "assets"; class QQmlFilePrivate; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) class QQmlFileNetworkReply : public QObject { Q_OBJECT @@ -117,12 +117,12 @@ public: Error error; QString errorString; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QQmlFileNetworkReply *reply; #endif }; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) int QQmlFileNetworkReply::finishedIndex = -1; int QQmlFileNetworkReply::downloadProgressIndex = -1; int QQmlFileNetworkReply::networkFinishedIndex = -1; @@ -205,11 +205,11 @@ void QQmlFileNetworkReply::networkDownloadProgress(qint64 a, qint64 b) { emit downloadProgress(a, b); } -#endif // QT_NO_NETWORK +#endif // qml_network QQmlFilePrivate::QQmlFilePrivate() : error(None) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) , reply(0) #endif { @@ -233,7 +233,7 @@ QQmlFile::QQmlFile(QQmlEngine *e, const QString &url) QQmlFile::~QQmlFile() { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) delete d->reply; #endif delete d; @@ -273,7 +273,7 @@ QQmlFile::Status QQmlFile::status() const { if (d->url.isEmpty() && d->urlString.isEmpty()) return Null; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) else if (d->reply) return Loading; #endif @@ -333,7 +333,7 @@ void QQmlFile::load(QQmlEngine *engine, const QUrl &url) d->error = QQmlFilePrivate::NotFound; } } else { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) d->reply = new QQmlFileNetworkReply(engine, d, url); #else d->error = QQmlFilePrivate::NotFound; @@ -364,7 +364,7 @@ void QQmlFile::load(QQmlEngine *engine, const QString &url) d->error = QQmlFilePrivate::NotFound; } } else { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QUrl qurl(url); d->url = qurl; d->urlString = QString(); @@ -388,7 +388,7 @@ void QQmlFile::clear(QObject *) clear(); } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) bool QQmlFile::connectFinished(QObject *object, const char *method) { if (!d || !d->reply) { diff --git a/src/qml/qml/qqmlfile.h b/src/qml/qml/qqmlfile.h index 3dd683a2cd..aec0981a95 100644 --- a/src/qml/qml/qqmlfile.h +++ b/src/qml/qml/qqmlfile.h @@ -80,7 +80,7 @@ public: void clear(); void clear(QObject *); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) bool connectFinished(QObject *, const char *); bool connectFinished(QObject *, int); bool connectDownloadProgress(QObject *, const char *); diff --git a/src/qml/qml/qqmlnetworkaccessmanagerfactory.cpp b/src/qml/qml/qqmlnetworkaccessmanagerfactory.cpp index c94db8e168..1680253d73 100644 --- a/src/qml/qml/qqmlnetworkaccessmanagerfactory.cpp +++ b/src/qml/qml/qqmlnetworkaccessmanagerfactory.cpp @@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) /*! \class QQmlNetworkAccessManagerFactory @@ -103,6 +103,6 @@ QQmlNetworkAccessManagerFactory::~QQmlNetworkAccessManagerFactory() implementation of this method is reentrant. */ -#endif //QT_NO_NETWORK +#endif // qml_network QT_END_NAMESPACE diff --git a/src/qml/qml/qqmlnetworkaccessmanagerfactory.h b/src/qml/qml/qqmlnetworkaccessmanagerfactory.h index ba3561b9f4..57dec1da29 100644 --- a/src/qml/qml/qqmlnetworkaccessmanagerfactory.h +++ b/src/qml/qml/qqmlnetworkaccessmanagerfactory.h @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) class QNetworkAccessManager; class Q_QML_EXPORT QQmlNetworkAccessManagerFactory @@ -56,7 +56,7 @@ public: }; -#endif //QT_NO_NETWORK +#endif // qml_network QT_END_NAMESPACE diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 87100d785e..1f1c9d7150 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -123,7 +123,7 @@ namespace { }; } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) // This is a lame object that we need to ensure that slots connected to // QNetworkReply get called in the correct thread (the loader thread). // As QQmlTypeLoader lives in the main thread, and we can't use @@ -143,7 +143,7 @@ public slots: private: QQmlTypeLoader *l; }; -#endif // QT_NO_NETWORK +#endif // qml_network class QQmlTypeLoaderThread : public QQmlThread { @@ -151,10 +151,10 @@ class QQmlTypeLoaderThread : public QQmlThread public: QQmlTypeLoaderThread(QQmlTypeLoader *loader); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *networkAccessManager() const; QQmlTypeLoaderNetworkReplyProxy *networkReplyProxy() const; -#endif // QT_NO_NETWORK +#endif // qml_network void load(QQmlDataBlob *b); void loadAsync(QQmlDataBlob *b); void loadWithStaticData(QQmlDataBlob *b, const QByteArray &); @@ -177,13 +177,13 @@ private: void initializeEngineMain(QQmlExtensionInterface *iface, const char *uri); QQmlTypeLoader *m_loader; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) mutable QNetworkAccessManager *m_networkAccessManager; mutable QQmlTypeLoaderNetworkReplyProxy *m_networkReplyProxy; -#endif // QT_NO_NETWORK +#endif // qml_network }; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QQmlTypeLoaderNetworkReplyProxy::QQmlTypeLoaderNetworkReplyProxy(QQmlTypeLoader *l) : l(l) { @@ -212,7 +212,7 @@ void QQmlTypeLoaderNetworkReplyProxy::manualFinished(QNetworkReply *reply) l->networkReplyProgress(reply, replySize, replySize); l->networkReplyFinished(reply); } -#endif // QT_NO_NETWORK +#endif // qml_network /*! \class QQmlDataBlob @@ -529,7 +529,7 @@ void QQmlDataBlob::done() { } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) /*! Invoked if there is a network error while fetching this blob. @@ -582,7 +582,7 @@ void QQmlDataBlob::networkError(QNetworkReply::NetworkError networkError) setError(error); } -#endif // QT_NO_NETWORK +#endif // qml_network /*! Called if \a blob, which was previously waited for, has an error. @@ -782,15 +782,15 @@ void QQmlDataBlob::ThreadData::setProgress(quint8 v) QQmlTypeLoaderThread::QQmlTypeLoaderThread(QQmlTypeLoader *loader) : m_loader(loader) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) , m_networkAccessManager(0), m_networkReplyProxy(0) -#endif // QT_NO_NETWORK +#endif // qml_network { // Do that after initializing all the members. startup(); } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *QQmlTypeLoaderThread::networkAccessManager() const { Q_ASSERT(isThisThread()); @@ -808,7 +808,7 @@ QQmlTypeLoaderNetworkReplyProxy *QQmlTypeLoaderThread::networkReplyProxy() const Q_ASSERT(m_networkReplyProxy); // Must call networkAccessManager() first return m_networkReplyProxy; } -#endif // QT_NO_NETWORK +#endif // qml_network void QQmlTypeLoaderThread::load(QQmlDataBlob *b) { @@ -866,12 +866,12 @@ void QQmlTypeLoaderThread::initializeEngine(QQmlExtensionInterface *iface, void QQmlTypeLoaderThread::shutdownThread() { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) delete m_networkAccessManager; m_networkAccessManager = 0; delete m_networkReplyProxy; m_networkReplyProxy = 0; -#endif // QT_NO_NETWORK +#endif // qml_network } void QQmlTypeLoaderThread::loadThread(QQmlDataBlob *b) @@ -957,14 +957,14 @@ void QQmlTypeLoader::invalidate() m_thread = 0; } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) // Need to delete the network replies after // the loader thread is shutdown as it could be // getting new replies while we clear them for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter) (*iter)->release(); m_networkReplies.clear(); -#endif // QT_NO_NETWORK +#endif // qml_network } void QQmlTypeLoader::lock() @@ -1138,7 +1138,7 @@ void QQmlTypeLoader::loadThread(QQmlDataBlob *blob) setData(blob, fileName); } else { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkReply *reply = m_thread->networkAccessManager()->get(QNetworkRequest(blob->m_url)); QQmlTypeLoaderNetworkReplyProxy *nrp = m_thread->networkReplyProxy(); blob->addref(); @@ -1156,14 +1156,14 @@ void QQmlTypeLoader::loadThread(QQmlDataBlob *blob) #ifdef DATABLOB_DEBUG qWarning("QQmlDataBlob: requested %s", qPrintable(blob->url().toString())); #endif // DATABLOB_DEBUG -#endif // QT_NO_NETWORK +#endif // qml_network } } #define DATALOADER_MAXIMUM_REDIRECT_RECURSION 16 #define TYPELOADER_MINIMUM_TRIM_THRESHOLD 64 -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void QQmlTypeLoader::networkReplyFinished(QNetworkReply *reply) { Q_ASSERT(m_thread->isThisThread()); @@ -1219,7 +1219,7 @@ void QQmlTypeLoader::networkReplyProgress(QNetworkReply *reply, m_thread->callDownloadProgressChanged(blob, blob->m_data.progress()); } } -#endif // QT_NO_NETWORK +#endif // qml_network /*! Return the QQmlEngine associated with this loader diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index 5c779e450d..53cf4234e1 100644 --- a/src/qml/qml/qqmltypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -51,9 +51,10 @@ // We mean it. // +#include <QtQml/qtqmlglobal.h> #include <QtCore/qobject.h> #include <QtCore/qatomic.h> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include <QtNetwork/qnetworkreply.h> #endif #include <QtQml/qqmlerror.h> @@ -154,7 +155,7 @@ protected: virtual void dataReceived(const Data &) = 0; virtual void initializeFromCachedUnit(const QQmlPrivate::CachedQmlUnit*) = 0; virtual void done(); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) virtual void networkError(QNetworkReply::NetworkError); #endif virtual void dependencyError(QQmlDataBlob *); @@ -320,16 +321,16 @@ public: private: friend class QQmlDataBlob; friend class QQmlTypeLoaderThread; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) friend class QQmlTypeLoaderNetworkReplyProxy; -#endif // QT_NO_NETWORK +#endif // qml_network void shutdownThread(); void loadThread(QQmlDataBlob *); void loadWithStaticDataThread(QQmlDataBlob *, const QByteArray &); void loadWithCachedUnitThread(QQmlDataBlob *blob, const QQmlPrivate::CachedQmlUnit *unit); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void networkReplyFinished(QNetworkReply *); void networkReplyProgress(QNetworkReply *, qint64, qint64); @@ -366,7 +367,7 @@ private: QQmlEngine *m_engine; QQmlTypeLoaderThread *m_thread; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) NetworkReplies m_networkReplies; #endif TypeCache m_typeCache; diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index f94946820f..10b1cbcfd4 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -70,7 +70,7 @@ using namespace QV4; -#if !defined(QT_NO_XMLSTREAMREADER) && !defined(QT_NO_NETWORK) +#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network) #define V4THROW_REFERENCE(string) { \ ScopedObject error(scope, ctx->engine()->newReferenceErrorObject(QStringLiteral(string))); \ @@ -2056,6 +2056,6 @@ void *qt_add_qmlxmlhttprequest(ExecutionEngine *v4) QT_END_NAMESPACE -#endif // QT_NO_XMLSTREAMREADER && QT_NO_NETWORK +#endif // QT_NO_XMLSTREAMREADER && qml_network #include <qqmlxmlhttprequest.moc> diff --git a/src/qml/qml/qqmlxmlhttprequest_p.h b/src/qml/qml/qqmlxmlhttprequest_p.h index df30873915..fdb6194537 100644 --- a/src/qml/qml/qqmlxmlhttprequest_p.h +++ b/src/qml/qml/qqmlxmlhttprequest_p.h @@ -55,7 +55,7 @@ #include <QtCore/qglobal.h> #include <private/qqmlglobal_p.h> -#if !defined(QT_NO_XMLSTREAMREADER) && !defined(QT_NO_NETWORK) +#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network) QT_BEGIN_NAMESPACE @@ -64,7 +64,7 @@ void qt_rem_qmlxmlhttprequest(QV4::ExecutionEngine *engine, void *); QT_END_NAMESPACE -#endif // QT_NO_XMLSTREAMREADER && QT_NO_NETWORK +#endif // QT_NO_XMLSTREAMREADER && qml_network #endif // QQMLXMLHTTPREQUEST_P_H diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index f15020f6c9..b0599dd0a2 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -160,8 +160,10 @@ QV8Engine::~QV8Engine() qDeleteAll(m_extensionData); m_extensionData.clear(); +#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network) qt_rem_qmlxmlhttprequest(m_v4Engine, m_xmlHttpRequestData); m_xmlHttpRequestData = 0; +#endif delete m_listModelData; m_listModelData = 0; @@ -169,7 +171,7 @@ QV8Engine::~QV8Engine() delete m_v4Engine; } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *QV8Engine::networkAccessManager() { return QQmlEnginePrivate::get(m_engine)->getNetworkAccessManager(); @@ -193,7 +195,7 @@ void QV8Engine::initializeGlobal() QQmlDateExtension::registerExtension(m_v4Engine); QQmlNumberExtension::registerExtension(m_v4Engine); -#if !defined(QT_NO_XMLSTREAMREADER) && !defined(QT_NO_NETWORK) +#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network) qt_add_domexceptions(m_v4Engine); m_xmlHttpRequestData = qt_add_qmlxmlhttprequest(m_v4Engine); #endif diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h index 390831609b..0cbe34fd30 100644 --- a/src/qml/qml/v8/qv8engine_p.h +++ b/src/qml/qml/v8/qv8engine_p.h @@ -188,7 +188,7 @@ public: void freezeObject(const QV4::Value &value); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) // Return the network access manager for this engine. By default this returns the network // access manager of the QQmlEngine. It is overridden in the case of a threaded v8 // instance (like in WorkerScript). diff --git a/src/qml/qtqmlglobal.h b/src/qml/qtqmlglobal.h index 34191d06b2..89228b7777 100644 --- a/src/qml/qtqmlglobal.h +++ b/src/qml/qtqmlglobal.h @@ -41,6 +41,10 @@ #define QTQMLGLOBAL_H #include <QtCore/qglobal.h> +#include <QtQml/qtqml-config.h> +#if QT_CONFIG(qml_network) +#include <QtNetwork/qtnetworkglobal.h> +#endif QT_BEGIN_NAMESPACE diff --git a/src/qml/qtqmlglobal_p.h b/src/qml/qtqmlglobal_p.h index 1b0872298d..63585fd62e 100644 --- a/src/qml/qtqmlglobal_p.h +++ b/src/qml/qtqmlglobal_p.h @@ -51,7 +51,9 @@ // We mean it. // -#include "qtqmlglobal.h" +#include <QtCore/private/qglobal_p.h> +#include <QtQml/private/qtqml-config_p.h> +#include <QtQml/qtqmlglobal.h> #if defined(QT_BUILD_QMLDEVTOOLS_LIB) || defined(QT_QMLDEVTOOLS_LIB) # define Q_QML_PRIVATE_EXPORT diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index 10666476fe..78e7776c9b 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -54,7 +54,7 @@ #include <QtCore/qdatetime.h> #include <QtQml/qqmlinfo.h> #include <QtQml/qqmlfile.h> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include <QtNetwork/qnetworkaccessmanager.h> #include "qqmlnetworkaccessmanagerfactory.h" #endif @@ -144,7 +144,7 @@ public: void init(); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) virtual QNetworkAccessManager *networkAccessManager(); #endif @@ -155,7 +155,7 @@ public: QV4::PersistentValue onmessage; private: QV4::PersistentValue createsend; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *accessManager; #endif }; @@ -202,7 +202,7 @@ private: QQuickWorkerScriptEnginePrivate::WorkerEngine::WorkerEngine(QQuickWorkerScriptEnginePrivate *parent) : QV8Engine(0), p(parent) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) , accessManager(0) #endif { @@ -211,7 +211,7 @@ QQuickWorkerScriptEnginePrivate::WorkerEngine::WorkerEngine(QQuickWorkerScriptEn QQuickWorkerScriptEnginePrivate::WorkerEngine::~WorkerEngine() { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) delete accessManager; #endif } @@ -274,7 +274,7 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::WorkerEngine::sendFunction(i return scope.result.asReturnedValue(); } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *QQuickWorkerScriptEnginePrivate::WorkerEngine::networkAccessManager() { if (!accessManager) { diff --git a/src/quick/configure.json b/src/quick/configure.json new file mode 100644 index 0000000000..3dbf653079 --- /dev/null +++ b/src/quick/configure.json @@ -0,0 +1,156 @@ +{ + "module": "quick", + "depends": [ + "qml-private", + "gui-private" + ], + + "commandline": { + "options": { + "d3d12": "boolean", + "quick-animatedimage": "boolean", + "quick-canvas": "boolean", + "quick-designer": "boolean", + "quick-flipable": "boolean", + "quick-gridview": "boolean", + "quick-listview": "boolean", + "quick-path": "boolean", + "quick-pathview": "boolean", + "quick-positioners": "boolean", + "quick-shadereffect": "boolean", + "quick-sprite": "boolean" + } + }, + + "tests": { + "d3d12": { + "label": "Direct3D 12", + "type": "compile", + "test": "d3d12" + } + }, + + "features": { + "d3d12": { + "label": "Direct3D 12", + "purpose": "Provides a Direct3D 12 backend for the Qt Quick Scenegraph", + "condition": "tests.d3d12", + "output": [ + "privateFeature" + ] + }, + "quick-animatedimage": { + "label": "AnimatedImage item", + "purpose": "Provides the Qt Quick AnimatedImage Item", + "condition": "features.movie", + "output": [ + "privateFeature" + ] + }, + "quick-canvas": { + "label": "Canvas item", + "purpose": "Provides the Qt Quick Canvas Item", + "output": [ + "privateFeature" + ] + }, + "quick-designer": { + "label": "Support for Quick Designer", + "purpose": "Provides support for the Qt Quick Designer in Qt Creator", + "output": [ + "privateFeature" + ] + }, + "quick-flipable": { + "label": "Flipable item", + "purpose": "Provides the Qt Quick Flipable Item", + "output": [ + "privateFeature" + ] + }, + "quick-gridview": { + "label": "GridView item", + "purpose": "Provides the Qt Quick GridView item", + "output": [ + "privateFeature" + ] + }, + "quick-itemview": { + "label": "ItemView item", + "condition": "features.quick-gridview || features.quick-listview", + "output": [ + "privateFeature" + ] + }, + "quick-viewtransitions": { + "label": "Transitions required for ItemViews and Positioners", + "condition": "features.quick-itemview || features.quick-positioners", + "output": [ + "privateFeature" + ] + }, + "quick-listview": { + "label": "ListView item", + "purpose": "Provides the Qt Quick ListView item", + "output": [ + "privateFeature" + ] + }, + "quick-path": { + "label": "Path support", + "purpose": "Provides Path elements in Qt Quick", + "output": [ + "privateFeature" + ] + }, + "quick-pathview": { + "label": "PathView item", + "purpose": "Provides the Qt Quick PathView item", + "condition": "features.quick-path", + "output": [ + "privateFeature" + ] + }, + "quick-positioners": { + "label": "Positioner items", + "purpose": "Provides Positioner items in Qt Quick", + "output": [ + "privateFeature" + ] + }, + "quick-shadereffect": { + "label": "ShaderEffect item", + "purpose": "Provides Shader effects in Qt Quick", + "output": [ + "privateFeature" + ] + }, + "quick-sprite": { + "label": "Sprite item", + "purpose": "Provides the Qt Quick Sprite Item", + "output": [ + "privateFeature" + ] + } + }, + + "summary": [ + { + "section": "Qt Quick", + "entries": [ + "d3d12", + "quick-animatedimage", + "quick-canvas", + "quick-designer", + "quick-flipable", + "quick-gridview", + "quick-listview", + "quick-path", + "quick-pathview", + "quick-positioners", + "quick-shadereffect", + "quick-sprite" + ] + } + ] +} diff --git a/src/quick/designer/qquickdesignersupport.cpp b/src/quick/designer/qquickdesignersupport.cpp index 44be12bb78..3ff5a3ce96 100644 --- a/src/quick/designer/qquickdesignersupport.cpp +++ b/src/quick/designer/qquickdesignersupport.cpp @@ -40,7 +40,9 @@ #include "qquickdesignersupport_p.h" #include <private/qquickitem_p.h> +#if QT_CONFIG(quick_shadereffect) #include <QtQuick/private/qquickshadereffectsource_p.h> +#endif #include <QtQuick/private/qquickrectangle_p.h> #include <QtQml/private/qabstractanimationjob_p.h> #include <private/qqmlengine_p.h> @@ -51,6 +53,7 @@ #include <private/qqmlvme_p.h> #include <private/qqmlcomponentattached_p.h> #include <private/qqmldata_p.h> +#include <private/qsgadaptationlayer_p.h> #include "qquickdesignerwindowmanager_p.h" diff --git a/src/quick/items/context2d/qquickcanvascontext_p.h b/src/quick/items/context2d/qquickcanvascontext_p.h index 4f71770e1a..0746b7dcd3 100644 --- a/src/quick/items/context2d/qquickcanvascontext_p.h +++ b/src/quick/items/context2d/qquickcanvascontext_p.h @@ -51,10 +51,13 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_canvas); + #include <QtQuick/qquickitem.h> #include <private/qv8engine_p.h> - QT_BEGIN_NAMESPACE class QQuickCanvasItem; diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h index 4f94393a45..8196debef1 100644 --- a/src/quick/items/context2d/qquickcanvasitem_p.h +++ b/src/quick/items/context2d/qquickcanvasitem_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_canvas); + #include <QtQuick/qquickitem.h> #include <private/qv8engine_p.h> #include <private/qqmlrefcount_p.h> diff --git a/src/quick/items/context2d/qquickcontext2d_p.h b/src/quick/items/context2d/qquickcontext2d_p.h index b526c8320d..e897263b6f 100644 --- a/src/quick/items/context2d/qquickcontext2d_p.h +++ b/src/quick/items/context2d/qquickcontext2d_p.h @@ -51,7 +51,10 @@ // We mean it. // -#include <QtQuick/qtquickglobal.h> +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_canvas); + #include <QtQml/qqml.h> #include <QtQml/qqmlcomponent.h> #include <private/qquickcanvascontext_p.h> diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h index f281cec2d5..3663e49f10 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_canvas); + #include <QtCore/qmutex.h> #include "qquickcontext2d_p.h" diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h index ed38382892..6a5d4e8b09 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture_p.h +++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_canvas); + #include <QtQuick/qsgtexture.h> #include "qquickcanvasitem_p.h" #include "qquickcontext2d_p.h" diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h index a87202daae..2f3fdeb54f 100644 --- a/src/quick/items/context2d/qquickcontext2dtile_p.h +++ b/src/quick/items/context2d/qquickcontext2dtile_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_canvas); + #include "qquickcontext2d_p.h" #ifndef QT_NO_OPENGL # include <QOpenGLFramebufferObject> diff --git a/src/quick/items/items.pri b/src/quick/items/items.pri index d91705451e..0f8061b5ef 100644 --- a/src/quick/items/items.pri +++ b/src/quick/items/items.pri @@ -41,19 +41,10 @@ HEADERS += \ $$PWD/qquickflickable_p.h \ $$PWD/qquickflickable_p_p.h \ $$PWD/qquickflickablebehavior_p.h \ - $$PWD/qquicklistview_p.h \ $$PWD/qquickrepeater_p.h \ $$PWD/qquickrepeater_p_p.h \ - $$PWD/qquickgridview_p.h \ - $$PWD/qquickpathview_p.h \ - $$PWD/qquickpathview_p_p.h \ - $$PWD/qquickpositioners_p.h \ - $$PWD/qquickpositioners_p_p.h \ $$PWD/qquickloader_p.h \ $$PWD/qquickloader_p_p.h \ - $$PWD/qquickanimatedimage_p.h \ - $$PWD/qquickanimatedimage_p_p.h \ - $$PWD/qquickflipable_p.h \ $$PWD/qquicktranslate_p.h \ $$PWD/qquickclipnode_p.h \ $$PWD/qquickview.h \ @@ -66,26 +57,13 @@ HEADERS += \ $$PWD/qquickdrag_p.h \ $$PWD/qquickdroparea_p.h \ $$PWD/qquickmultipointtoucharea_p.h \ - $$PWD/qquickitemview_p.h \ - $$PWD/qquickitemview_p_p.h \ - $$PWD/qquickitemviewtransition_p.h \ $$PWD/qquickscreen_p.h \ $$PWD/qquickwindowattached_p.h \ $$PWD/qquickwindowmodule_p.h \ - $$PWD/qquickshadereffectsource_p.h \ - $$PWD/qquickshadereffectmesh_p.h \ - $$PWD/qquickshadereffect_p.h \ - $$PWD/qquickgenericshadereffect_p.h \ $$PWD/qquickrendercontrol.h \ $$PWD/qquickrendercontrol_p.h \ $$PWD/qquickgraphicsinfo_p.h \ - $$PWD/qquickitemgrabresult.h \ - $$PWD/qquickspriteengine_p.h \ - $$PWD/qquicksprite_p.h \ - $$PWD/qquickspritesequence_p.h \ - $$PWD/qquickanimatedsprite_p.h \ - $$PWD/qquickanimatedsprite_p_p.h \ - $$PWD/qquickspritesequence_p_p.h + $$PWD/qquickitemgrabresult.h SOURCES += \ $$PWD/qquickevents.cpp \ @@ -111,14 +89,8 @@ SOURCES += \ $$PWD/qquickmousearea.cpp \ $$PWD/qquickpincharea.cpp \ $$PWD/qquickflickable.cpp \ - $$PWD/qquicklistview.cpp \ $$PWD/qquickrepeater.cpp \ - $$PWD/qquickgridview.cpp \ - $$PWD/qquickpathview.cpp \ - $$PWD/qquickpositioners.cpp \ $$PWD/qquickloader.cpp \ - $$PWD/qquickanimatedimage.cpp \ - $$PWD/qquickflipable.cpp \ $$PWD/qquicktranslate.cpp \ $$PWD/qquickclipnode.cpp \ $$PWD/qquickview.cpp \ @@ -129,49 +101,133 @@ SOURCES += \ $$PWD/qquickdrag.cpp \ $$PWD/qquickdroparea.cpp \ $$PWD/qquickmultipointtoucharea.cpp \ - $$PWD/qquickitemview.cpp \ - $$PWD/qquickitemviewtransition.cpp \ $$PWD/qquickwindowmodule.cpp \ $$PWD/qquickscreen.cpp \ $$PWD/qquickwindowattached.cpp \ - $$PWD/qquickshadereffectsource.cpp \ - $$PWD/qquickshadereffectmesh.cpp \ - $$PWD/qquickshadereffect.cpp \ - $$PWD/qquickgenericshadereffect.cpp \ $$PWD/qquickrendercontrol.cpp \ $$PWD/qquickgraphicsinfo.cpp \ - $$PWD/qquickitemgrabresult.cpp \ - $$PWD/qquickspriteengine.cpp \ - $$PWD/qquicksprite.cpp \ - $$PWD/qquickspritesequence.cpp \ - $$PWD/qquickanimatedsprite.cpp + $$PWD/qquickitemgrabresult.cpp + +qtConfig(quick-animatedimage) { + HEADERS += \ + $$PWD/qquickanimatedimage_p.h \ + $$PWD/qquickanimatedimage_p_p.h + SOURCES += \ + $$PWD/qquickanimatedimage.cpp +} + +qtConfig(quick-gridview) { + HEADERS += \ + $$PWD/qquickgridview_p.h + SOURCES += \ + $$PWD/qquickgridview.cpp +} + +qtConfig(quick-itemview) { + HEADERS += \ + $$PWD/qquickitemview_p.h \ + $$PWD/qquickitemview_p_p.h + SOURCES += \ + $$PWD/qquickitemview.cpp +} + +qtConfig(quick-viewtransitions) { + HEADERS += \ + $$PWD/qquickitemviewtransition_p.h + SOURCES += \ + $$PWD/qquickitemviewtransition.cpp +} + +qtConfig(quick-listview) { + HEADERS += \ + $$PWD/qquicklistview_p.h + SOURCES += \ + $$PWD/qquicklistview.cpp +} + +qtConfig(quick-pathview) { + HEADERS += \ + $$PWD/qquickpathview_p.h \ + $$PWD/qquickpathview_p_p.h + SOURCES += \ + $$PWD/qquickpathview.cpp +} + +qtConfig(quick-positioners) { + HEADERS += \ + $$PWD/qquickpositioners_p.h \ + $$PWD/qquickpositioners_p_p.h + SOURCES += \ + $$PWD/qquickpositioners.cpp +} + +qtConfig(quick-flipable) { + HEADERS += \ + $$PWD/qquickflipable_p.h + SOURCES += \ + $$PWD/qquickflipable.cpp +} + +qtConfig(quick-shadereffect) { + HEADERS += \ + $$PWD/qquickshadereffectsource_p.h \ + $$PWD/qquickshadereffectmesh_p.h \ + $$PWD/qquickshadereffect_p.h \ + $$PWD/qquickgenericshadereffect_p.h + SOURCES += \ + $$PWD/qquickshadereffectsource.cpp \ + $$PWD/qquickshadereffectmesh.cpp \ + $$PWD/qquickshadereffect.cpp \ + $$PWD/qquickgenericshadereffect.cpp + + qtConfig(opengl) { + SOURCES += \ + $$PWD/qquickopenglshadereffect.cpp \ + $$PWD/qquickopenglshadereffectnode.cpp + HEADERS += \ + $$PWD/qquickopenglshadereffect_p.h \ + $$PWD/qquickopenglshadereffectnode_p.h + + OTHER_FILES += \ + $$PWD/shaders/shadereffect.vert \ + $$PWD/shaders/shadereffect.frag \ + $$PWD/shaders/shadereffectfallback.vert \ + $$PWD/shaders/shadereffectfallback.frag \ + $$PWD/shaders/shadereffect_core.vert \ + $$PWD/shaders/shadereffect_core.frag \ + $$PWD/shaders/shadereffectfallback_core.vert \ + $$PWD/shaders/shadereffectfallback_core.frag + } +} + +qtConfig(quick-sprite) { + HEADERS += \ + $$PWD/qquickspriteengine_p.h \ + $$PWD/qquicksprite_p.h \ + $$PWD/qquickspritesequence_p.h \ + $$PWD/qquickanimatedsprite_p.h \ + $$PWD/qquickanimatedsprite_p_p.h \ + $$PWD/qquickspritesequence_p_p.h + SOURCES += \ + $$PWD/qquickspriteengine.cpp \ + $$PWD/qquicksprite.cpp \ + $$PWD/qquickspritesequence.cpp \ + $$PWD/qquickanimatedsprite.cpp +} # Items that depend on OpenGL Renderer qtConfig(opengl(es1|es2)?) { SOURCES += \ $$PWD/qquickopenglinfo.cpp \ - $$PWD/qquickopenglshadereffect.cpp \ - $$PWD/qquickopenglshadereffectnode.cpp \ $$PWD/qquickframebufferobject.cpp HEADERS += \ $$PWD/qquickopenglinfo_p.h \ - $$PWD/qquickopenglshadereffect_p.h \ - $$PWD/qquickopenglshadereffectnode_p.h \ $$PWD/qquickframebufferobject.h - - OTHER_FILES += \ - $$PWD/shaders/shadereffect.vert \ - $$PWD/shaders/shadereffect.frag \ - $$PWD/shaders/shadereffectfallback.vert \ - $$PWD/shaders/shadereffectfallback.frag \ - $$PWD/shaders/shadereffect_core.vert \ - $$PWD/shaders/shadereffect_core.frag \ - $$PWD/shaders/shadereffectfallback_core.vert \ - $$PWD/shaders/shadereffectfallback_core.frag } RESOURCES += \ $$PWD/items.qrc -include(context2d/context2d.pri) +qtConfig(quick-canvas): \ + include(context2d/context2d.pri) diff --git a/src/quick/items/qquickanimatedimage.cpp b/src/quick/items/qquickanimatedimage.cpp index 6f14bf15fe..81c649dbd5 100644 --- a/src/quick/items/qquickanimatedimage.cpp +++ b/src/quick/items/qquickanimatedimage.cpp @@ -40,14 +40,12 @@ #include "qquickanimatedimage_p.h" #include "qquickanimatedimage_p_p.h" -#ifndef QT_NO_MOVIE - #include <QtGui/qguiapplication.h> #include <QtQml/qqmlinfo.h> #include <QtQml/qqmlfile.h> #include <QtQml/qqmlengine.h> #include <QtGui/qmovie.h> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include <QtNetwork/qnetworkrequest.h> #include <QtNetwork/qnetworkreply.h> #endif @@ -146,7 +144,7 @@ QQuickAnimatedImage::QQuickAnimatedImage(QQuickItem *parent) QQuickAnimatedImage::~QQuickAnimatedImage() { Q_D(QQuickAnimatedImage); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) if (d->reply) d->reply->deleteLater(); #endif @@ -268,7 +266,7 @@ void QQuickAnimatedImage::setSource(const QUrl &url) if (url == d->url) return; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) if (d->reply) { d->reply->deleteLater(); d->reply = 0; @@ -325,7 +323,7 @@ void QQuickAnimatedImage::load() d->_movie = new QMovie(lf); movieRequestFinished(); } else { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) if (d->status != Loading) { d->status = Loading; emit statusChanged(d->status); @@ -354,7 +352,7 @@ void QQuickAnimatedImage::movieRequestFinished() Q_D(QQuickAnimatedImage); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) if (d->reply) { d->redirectCount++; if (d->redirectCount < ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION) { @@ -493,5 +491,3 @@ void QQuickAnimatedImage::componentComplete() } QT_END_NAMESPACE - -#endif // QT_NO_MOVIE diff --git a/src/quick/items/qquickanimatedimage_p.h b/src/quick/items/qquickanimatedimage_p.h index 288a8379da..143fe8904d 100644 --- a/src/quick/items/qquickanimatedimage_p.h +++ b/src/quick/items/qquickanimatedimage_p.h @@ -51,9 +51,11 @@ // We mean it. // -#include "qquickimage_p.h" +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_animatedimage); -#ifndef QT_NO_MOVIE +#include "qquickimage_p.h" QT_BEGIN_NAMESPACE @@ -116,6 +118,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickAnimatedImage) -#endif // QT_NO_MOVIE - #endif // QQUICKANIMATEDIMAGE_P_H diff --git a/src/quick/items/qquickanimatedimage_p_p.h b/src/quick/items/qquickanimatedimage_p_p.h index ed735d1c9c..9eff6a44e3 100644 --- a/src/quick/items/qquickanimatedimage_p_p.h +++ b/src/quick/items/qquickanimatedimage_p_p.h @@ -51,14 +51,16 @@ // We mean it. // -#include "qquickimage_p_p.h" +#include <QtQuick/qtquickglobal.h> + +QT_REQUIRE_CONFIG(quick_animatedimage); -#ifndef QT_NO_MOVIE +#include "qquickimage_p_p.h" QT_BEGIN_NAMESPACE class QMovie; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) class QNetworkReply; #endif @@ -69,7 +71,7 @@ class QQuickAnimatedImagePrivate : public QQuickImagePrivate public: QQuickAnimatedImagePrivate() : playing(true), paused(false), preset_currentframe(0), _movie(0), oldPlaying(false) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) , reply(0), redirectCount(0) #endif , currentSourceSize(0, 0) @@ -83,7 +85,7 @@ public: int preset_currentframe; QMovie *_movie; bool oldPlaying; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkReply *reply; int redirectCount; #endif @@ -93,6 +95,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_MOVIE - #endif // QQUICKANIMATEDIMAGE_P_P_H diff --git a/src/quick/items/qquickanimatedsprite_p.h b/src/quick/items/qquickanimatedsprite_p.h index 564c402fbb..850461a011 100644 --- a/src/quick/items/qquickanimatedsprite_p.h +++ b/src/quick/items/qquickanimatedsprite_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include <QtQuick/QQuickItem> #include <private/qquicksprite_p.h> #include <QtCore/qelapsedtimer.h> diff --git a/src/quick/items/qquickanimatedsprite_p_p.h b/src/quick/items/qquickanimatedsprite_p_p.h index 0e4a1e9066..3610e58861 100644 --- a/src/quick/items/qquickanimatedsprite_p_p.h +++ b/src/quick/items/qquickanimatedsprite_p_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <QtQuick/qtquickglobal.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include "qquickitem_p.h" #include "qquicksprite_p.h" diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp index ca5ad8dbbd..67b99bfbc6 100644 --- a/src/quick/items/qquickborderimage.cpp +++ b/src/quick/items/qquickborderimage.cpp @@ -43,7 +43,7 @@ #include <QtQml/qqmlinfo.h> #include <QtQml/qqmlfile.h> #include <QtQml/qqmlengine.h> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include <QtNetwork/qnetworkreply.h> #endif #include <QtCore/qfile.h> @@ -51,6 +51,7 @@ #include <QtGui/qguiapplication.h> #include <private/qqmlglobal_p.h> +#include <private/qsgadaptationlayer_p.h> QT_BEGIN_NAMESPACE @@ -171,7 +172,7 @@ QQuickBorderImage::QQuickBorderImage(QQuickItem *parent) QQuickBorderImage::~QQuickBorderImage() { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) Q_D(QQuickBorderImage); if (d->sciReply) d->sciReply->deleteLater(); @@ -274,7 +275,7 @@ void QQuickBorderImage::setSource(const QUrl &url) if (url == d->url) return; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) if (d->sciReply) { d->sciReply->deleteLater(); d->sciReply = 0; @@ -317,7 +318,7 @@ void QQuickBorderImage::load() setGridScaledImage(QQuickGridScaledImage(&file)); return; } else { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) if (d->progress != 0.0) { d->progress = 0.0; emit progressChanged(d->progress); @@ -537,7 +538,7 @@ void QQuickBorderImage::requestFinished() pixmapChange(); } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #define BORDERIMAGE_MAX_REDIRECT 16 void QQuickBorderImage::sciRequestFinished() @@ -567,7 +568,7 @@ void QQuickBorderImage::sciRequestFinished() setGridScaledImage(sci); } } -#endif // QT_NO_NETWORK +#endif // qml_network void QQuickBorderImage::doUpdate() { diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h index f2764660f6..844f71e2c9 100644 --- a/src/quick/items/qquickborderimage_p.h +++ b/src/quick/items/qquickborderimage_p.h @@ -101,7 +101,7 @@ private: private Q_SLOTS: void doUpdate(); void requestFinished() Q_DECL_OVERRIDE; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void sciRequestFinished(); #endif diff --git a/src/quick/items/qquickborderimage_p_p.h b/src/quick/items/qquickborderimage_p_p.h index 56fbbab049..0f4e7acc05 100644 --- a/src/quick/items/qquickborderimage_p_p.h +++ b/src/quick/items/qquickborderimage_p_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) class QNetworkReply; #endif class QQuickBorderImagePrivate : public QQuickImageBasePrivate @@ -69,7 +69,7 @@ public: QQuickBorderImagePrivate() : border(0), horizontalTileMode(QQuickBorderImage::Stretch), verticalTileMode(QQuickBorderImage::Stretch), pixmapChanged(false) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) , sciReply(0), redirectCount(0) #endif { @@ -108,7 +108,7 @@ public: QQuickBorderImage::TileMode verticalTileMode; bool pixmapChanged : 1; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkReply *sciReply; int redirectCount; #endif diff --git a/src/quick/items/qquickflipable_p.h b/src/quick/items/qquickflipable_p.h index 189d94775a..17a74d1f7a 100644 --- a/src/quick/items/qquickflipable_p.h +++ b/src/quick/items/qquickflipable_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_flipable); + #include "qquickitem.h" #include <QtGui/qtransform.h> diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp index 857cd44b15..18a6a58467 100644 --- a/src/quick/items/qquickframebufferobject.cpp +++ b/src/quick/items/qquickframebufferobject.cpp @@ -42,6 +42,8 @@ #include <QtGui/QOpenGLFramebufferObject> #include <QtGui/QOpenGLFunctions> #include <private/qquickitem_p.h> +#include <private/qsgadaptationlayer_p.h> +#include <qsgtextureprovider.h> #include <QSGSimpleTextureNode> #include <QSGRendererInterface> diff --git a/src/quick/items/qquickgridview_p.h b/src/quick/items/qquickgridview_p.h index 44bc8444f2..aaf6e4a75b 100644 --- a/src/quick/items/qquickgridview_p.h +++ b/src/quick/items/qquickgridview_p.h @@ -51,8 +51,11 @@ // We mean it. // -#include "qquickitemview_p.h" +#include <QtQuick/private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_gridview); +#include "qquickitemview_p.h" QT_BEGIN_NAMESPACE diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 814a73d9a4..e219e9b34e 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2344,7 +2344,9 @@ QQuickItem::~QQuickItem() if (d->extra.isAllocated()) { delete d->extra->contents; d->extra->contents = 0; +#if QT_CONFIG(quick_shadereffect) delete d->extra->layer; d->extra->layer = 0; +#endif } delete d->_anchors; d->_anchors = 0; @@ -4774,8 +4776,10 @@ void QQuickItem::classBegin() d->_stateGroup->classBegin(); if (d->_anchors) d->_anchors->classBegin(); +#if QT_CONFIG(quick_shadereffect) if (d->extra.isAllocated() && d->extra->layer) d->extra->layer->classBegin(); +#endif } /*! @@ -4795,8 +4799,10 @@ void QQuickItem::componentComplete() } if (d->extra.isAllocated()) { +#if QT_CONFIG(quick_shadereffect) if (d->extra->layer) d->extra->layer->componentComplete(); +#endif if (d->extra->keyHandler) d->extra->keyHandler->componentComplete(); @@ -4852,8 +4858,10 @@ QPointF QQuickItemPrivate::computeTransformOrigin() const void QQuickItemPrivate::transformChanged() { +#if QT_CONFIG(quick_shadereffect) if (extra.isAllocated() && extra->layer) extra->layer->updateMatrix(); +#endif } void QQuickItemPrivate::deliverKeyEvent(QKeyEvent *e) @@ -5235,8 +5243,10 @@ void QQuickItem::setZ(qreal v) emit zChanged(); +#if QT_CONFIG(quick_shadereffect) if (d->extra.isAllocated() && d->extra->layer) d->extra->layer->updateZ(); +#endif } /*! @@ -7638,9 +7648,13 @@ QDebug operator<<(QDebug debug, QQuickItem *item) bool QQuickItem::isTextureProvider() const { +#if QT_CONFIG(quick_shadereffect) Q_D(const QQuickItem); return d->extra.isAllocated() && d->extra->layer && d->extra->layer->effectSource() ? d->extra->layer->effectSource()->isTextureProvider() : false; +#else + return false; +#endif } /*! @@ -7654,9 +7668,13 @@ bool QQuickItem::isTextureProvider() const QSGTextureProvider *QQuickItem::textureProvider() const { +#if QT_CONFIG(quick_shadereffect) Q_D(const QQuickItem); return d->extra.isAllocated() && d->extra->layer && d->extra->layer->effectSource() ? d->extra->layer->effectSource()->textureProvider() : 0; +#else + return 0; +#endif } /*! @@ -7665,14 +7683,19 @@ QSGTextureProvider *QQuickItem::textureProvider() const */ QQuickItemLayer *QQuickItemPrivate::layer() const { +#if QT_CONFIG(quick_shadereffect) if (!extra.isAllocated() || !extra->layer) { extra.value().layer = new QQuickItemLayer(const_cast<QQuickItem *>(q_func())); if (!componentComplete) extra->layer->classBegin(); } return extra->layer; +#else + return 0; +#endif } +#if QT_CONFIG(quick_shadereffect) QQuickItemLayer::QQuickItemLayer(QQuickItem *item) : m_item(item) , m_enabled(false) @@ -8160,12 +8183,16 @@ void QQuickItemLayer::updateMatrix() ld->extra.value().origin = QQuickItemPrivate::get(m_item)->origin(); ld->dirty(QQuickItemPrivate::Transform); } +#endif // quick_shadereffect QQuickItemPrivate::ExtraData::ExtraData() : z(0), scale(1), rotation(0), opacity(1), contents(0), screenAttached(0), layoutDirectionAttached(0), enterKeyAttached(0), - keyHandler(0), layer(0), + keyHandler(0), +#if QT_CONFIG(quick_shadereffect) + layer(0), +#endif effectRefCount(0), hideRefCount(0), opacityNode(0), clipNode(0), rootNode(0), acceptedMouseButtons(0), origin(QQuickItem::Center), diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 49a674f2c6..4bff293657 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -76,7 +76,9 @@ #include <QtCore/qdebug.h> #include <QtCore/qelapsedtimer.h> +#if QT_CONFIG(quick_shadereffect) #include <QtQuick/private/qquickshadereffectsource_p.h> +#endif QT_BEGIN_NAMESPACE @@ -135,6 +137,7 @@ public: QList<QQuickItem *> items; }; +#if QT_CONFIG(quick_shadereffect) class QQuickItemLayer : public QObject, public QQuickItemChangeListener { @@ -236,6 +239,8 @@ private: QQuickShaderEffectSource::TextureMirroring m_textureMirroring; }; +#endif + class Q_QUICK_PRIVATE_EXPORT QQuickItemPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QQuickItem) @@ -339,7 +344,9 @@ public: QQuickLayoutMirroringAttached* layoutDirectionAttached; QQuickEnterKeyAttached *enterKeyAttached; QQuickItemKeyFilter *keyHandler; +#if QT_CONFIG(quick_shadereffect) mutable QQuickItemLayer *layer; +#endif #ifndef QT_NO_CURSOR QCursor cursor; #endif @@ -923,7 +930,9 @@ Q_DECLARE_TYPEINFO(QQuickItemPrivate::ChangeListener, Q_PRIMITIVE_TYPE); QT_END_NAMESPACE +#if QT_CONFIG(quick_shadereffect) QML_DECLARE_TYPE(QQuickItemLayer) +#endif QML_DECLARE_TYPE(QQuickKeysAttached) QML_DECLARE_TYPEINFO(QQuickKeysAttached, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(QQuickKeyNavigationAttached) diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp index 5c0caf5ca2..fd4a7d733f 100644 --- a/src/quick/items/qquickitemanimation.cpp +++ b/src/quick/items/qquickitemanimation.cpp @@ -42,7 +42,9 @@ #include "qquickstateoperations_p.h" #include <private/qqmlproperty_p.h> +#if QT_CONFIG(quick_path) #include <private/qquickpath_p.h> +#endif #include "private/qparallelanimationgroupjob_p.h" #include "private/qsequentialanimationgroupjob_p.h" @@ -554,6 +556,8 @@ QAbstractAnimationJob* QQuickAnchorAnimation::transition(QQuickStateActions &act return initInstance(animator); } + +#if QT_CONFIG(quick_path) /*! \qmltype PathAnimation \instantiates QQuickPathAnimation @@ -1044,4 +1048,6 @@ QQuickPathAnimationAnimator::~QQuickPathAnimationAnimator() } } +#endif // quick_path + QT_END_NAMESPACE diff --git a/src/quick/items/qquickitemanimation_p.h b/src/quick/items/qquickitemanimation_p.h index df80272eaa..a503cff223 100644 --- a/src/quick/items/qquickitemanimation_p.h +++ b/src/quick/items/qquickitemanimation_p.h @@ -124,6 +124,8 @@ protected: QObject *defaultTarget = 0) Q_DECL_OVERRIDE; }; +#if QT_CONFIG(quick_path) + class QQuickItem; class QQuickPath; class QQuickPathAnimationPrivate; @@ -199,10 +201,14 @@ Q_SIGNALS: void endRotationChanged(qreal); }; +#endif + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickParentAnimation) QML_DECLARE_TYPE(QQuickAnchorAnimation) +#if QT_CONFIG(quick_path) QML_DECLARE_TYPE(QQuickPathAnimation) +#endif #endif // QQUICKITEMANIMATION_H diff --git a/src/quick/items/qquickitemanimation_p_p.h b/src/quick/items/qquickitemanimation_p_p.h index 5b18e4b0ae..92dd84e4a9 100644 --- a/src/quick/items/qquickitemanimation_p_p.h +++ b/src/quick/items/qquickitemanimation_p_p.h @@ -53,7 +53,9 @@ #include "qquickitemanimation_p.h" +#if QT_CONFIG(quick_path) #include <private/qquickpath_p.h> +#endif #include <private/qquickanimation_p_p.h> QT_BEGIN_NAMESPACE @@ -84,6 +86,8 @@ public: QList<QQuickItem*> targets; }; +#if QT_CONFIG(quick_path) + class QQuickPathAnimationUpdater : public QQuickBulkValueUpdater { public: @@ -153,6 +157,7 @@ public: QHash<QQuickItem*, QQuickPathAnimationAnimator* > activeAnimations; }; +#endif QT_END_NAMESPACE diff --git a/src/quick/items/qquickitemgrabresult.cpp b/src/quick/items/qquickitemgrabresult.cpp index 0db5323863..1b0e1f07f6 100644 --- a/src/quick/items/qquickitemgrabresult.cpp +++ b/src/quick/items/qquickitemgrabresult.cpp @@ -37,17 +37,21 @@ ** ****************************************************************************/ +#include <private/qtquickglobal_p.h> #include "qquickitemgrabresult.h" #include "qquickwindow.h" #include "qquickitem.h" +#if QT_CONFIG(quick_shadereffect) #include "qquickshadereffectsource_p.h" +#endif #include <QtQml/QQmlEngine> #include <private/qquickpixmapcache_p.h> #include <private/qquickitem_p.h> #include <private/qsgcontext_p.h> +#include <private/qsgadaptationlayer_p.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 1bc1aebe4f..944f24c4ad 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -55,34 +55,56 @@ #include "qquickpincharea_p.h" #include "qquickflickable_p.h" #include "qquickflickable_p_p.h" +#if QT_CONFIG(quick_listview) #include "qquicklistview_p.h" +#endif +#if QT_CONFIG(quick_gridview) #include "qquickgridview_p.h" +#endif +#if QT_CONFIG(quick_pathview) #include "qquickpathview_p.h" +#endif +#if QT_CONFIG(quick_viewtransitions) #include "qquickitemviewtransition_p.h" +#endif +#if QT_CONFIG(quick_path) #include <private/qquickpath_p.h> #include <private/qquickpathinterpolator_p.h> +#endif +#if QT_CONFIG(quick_positioners) #include "qquickpositioners_p.h" +#endif #include "qquickrepeater_p.h" #include "qquickloader_p.h" +#if QT_CONFIG(quick_animatedimage) #include "qquickanimatedimage_p.h" +#endif +#if QT_CONFIG(quick_flipable) #include "qquickflipable_p.h" +#endif #include "qquicktranslate_p.h" #include "qquickstateoperations_p.h" #include "qquickitemanimation_p.h" -#include <QtQuick/private/qquickshadereffectsource_p.h> //#include <private/qquickpincharea_p.h> +#if QT_CONFIG(quick_canvas) #include <QtQuick/private/qquickcanvasitem_p.h> #include <QtQuick/private/qquickcontext2d_p.h> +#endif #include "qquickitemgrabresult.h" +#if QT_CONFIG(quick_sprite) #include "qquicksprite_p.h" #include "qquickspritesequence_p.h" #include "qquickanimatedsprite_p.h" +#endif #ifndef QT_NO_OPENGL # include "qquickopenglinfo_p.h" #endif #include "qquickgraphicsinfo_p.h" +#if QT_CONFIG(quick_shadereffect) +#include <QtQuick/private/qquickshadereffectsource_p.h> #include "qquickshadereffect_p.h" #include "qquickshadereffectmesh_p.h" +#endif #include "qquickdrag_p.h" #include "qquickdroparea_p.h" #include "qquickmultipointtoucharea_p.h" @@ -134,27 +156,40 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent); -#ifdef QT_NO_MOVIE +#if !QT_CONFIG(quick_animatedimage) qmlRegisterTypeNotAvailable(uri,major,minor,"AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage","Qt was built without support for QMovie")); #else qmlRegisterType<QQuickAnimatedImage>(uri,major,minor,"AnimatedImage"); #endif qmlRegisterType<QQuickBorderImage>(uri,major,minor,"BorderImage"); - qmlRegisterType<QQuickColumn>(uri,major,minor,"Column"); qmlRegisterType<QQuickFlickable>(uri,major,minor,"Flickable"); +#if QT_CONFIG(quick_flipable) qmlRegisterType<QQuickFlipable>(uri,major,minor,"Flipable"); - qmlRegisterType<QQuickFlow>(uri,major,minor,"Flow"); +#endif // qmlRegisterType<QQuickFocusPanel>(uri,major,minor,"FocusPanel"); qmlRegisterType<QQuickFocusScope>(uri,major,minor,"FocusScope"); qmlRegisterType<QQuickGradient>(uri,major,minor,"Gradient"); qmlRegisterType<QQuickGradientStop>(uri,major,minor,"GradientStop"); +#if QT_CONFIG(quick_positioners) + qmlRegisterType<QQuickColumn>(uri,major,minor,"Column"); + qmlRegisterType<QQuickFlow>(uri,major,minor,"Flow"); qmlRegisterType<QQuickGrid>(uri,major,minor,"Grid"); + qmlRegisterUncreatableType<QQuickBasePositioner>(uri,major,minor,"Positioner", + QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); + qmlRegisterType<QQuickRow>(uri,major,minor,"Row"); +#endif +#if QT_CONFIG(quick_gridview) qmlRegisterType<QQuickGridView>(uri,major,minor,"GridView"); +#endif qmlRegisterType<QQuickImage>(uri,major,minor,"Image"); qmlRegisterType<QQuickItem>(uri,major,minor,"Item"); +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView>(uri,major,minor,"ListView"); + qmlRegisterType<QQuickViewSection>(uri,major,minor,"ViewSection"); +#endif qmlRegisterType<QQuickLoader>(uri,major,minor,"Loader"); qmlRegisterType<QQuickMouseArea>(uri,major,minor,"MouseArea"); +#if QT_CONFIG(quick_path) qmlRegisterType<QQuickPath>(uri,major,minor,"Path"); qmlRegisterType<QQuickPathAttribute>(uri,major,minor,"PathAttribute"); qmlRegisterType<QQuickPathCubic>(uri,major,minor,"PathCubic"); @@ -164,12 +199,12 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickPathCatmullRomCurve>("QtQuick",2,0,"PathCurve"); qmlRegisterType<QQuickPathArc>("QtQuick",2,0,"PathArc"); qmlRegisterType<QQuickPathSvg>("QtQuick",2,0,"PathSvg"); +#endif +#if QT_CONFIG(quick_pathview) qmlRegisterType<QQuickPathView>(uri,major,minor,"PathView"); - qmlRegisterUncreatableType<QQuickBasePositioner>(uri,major,minor,"Positioner", - QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); +#endif qmlRegisterType<QQuickRectangle>(uri,major,minor,"Rectangle"); qmlRegisterType<QQuickRepeater>(uri,major,minor,"Repeater"); - qmlRegisterType<QQuickRow>(uri,major,minor,"Row"); qmlRegisterType<QQuickTranslate>(uri,major,minor,"Translate"); qmlRegisterType<QQuickRotation>(uri,major,minor,"Rotation"); qmlRegisterType<QQuickScale>(uri,major,minor,"Scale"); @@ -180,17 +215,20 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickTextInput>(uri,major,minor,"TextInput"); qmlRegisterType<QQuickTextInput,2>(uri,2,2,"TextInput"); qmlRegisterType<QQuickTextInput,3>(uri,2,4,"TextInput"); - qmlRegisterType<QQuickViewSection>(uri,major,minor,"ViewSection"); qmlRegisterType<QQuickItemGrabResult>(); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickItemLayer>(); +#endif qmlRegisterType<QQuickAnchors>(); qmlRegisterType<QQuickKeyEvent>(); qmlRegisterType<QQuickMouseEvent>(); qmlRegisterType<QQuickWheelEvent>(); qmlRegisterType<QQuickCloseEvent>(); qmlRegisterType<QQuickTransform>(); +#if QT_CONFIG(quick_path) qmlRegisterType<QQuickPathElement>(); qmlRegisterType<QQuickCurve>(); +#endif qmlRegisterType<QQuickScaleGrid>(); qmlRegisterType<QQuickTextLine>(); qmlRegisterType<QQuickPen>(); @@ -203,32 +241,42 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterUncreatableType<QQuickKeyNavigationAttached>(uri,major,minor,"KeyNavigation",QQuickKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); qmlRegisterUncreatableType<QQuickKeysAttached>(uri,major,minor,"Keys",QQuickKeysAttached::tr("Keys is only available via attached properties")); qmlRegisterUncreatableType<QQuickLayoutMirroringAttached>(uri,major,minor,"LayoutMirroring", QQuickLayoutMirroringAttached::tr("LayoutMirroring is only available via attached properties")); +#if QT_CONFIG(quick_viewtransitions) qmlRegisterUncreatableType<QQuickViewTransitionAttached>(uri,major,minor,"ViewTransition",QQuickViewTransitionAttached::tr("ViewTransition is only available via attached properties")); +#endif qmlRegisterType<QQuickPinchArea>(uri,major,minor,"PinchArea"); qmlRegisterType<QQuickPinch>(uri,major,minor,"Pinch"); qmlRegisterType<QQuickPinchEvent>(); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickShaderEffectSource>("QtQuick", 2, 0, "ShaderEffectSource"); qmlRegisterUncreatableType<QQuickShaderEffectMesh>("QtQuick", 2, 0, "ShaderEffectMesh", QQuickShaderEffectMesh::tr("Cannot create instance of abstract class ShaderEffectMesh.")); qmlRegisterType<QQuickGridMesh>("QtQuick", 2, 0, "GridMesh"); qmlRegisterType<QQuickShaderEffect>("QtQuick", 2, 0, "ShaderEffect"); +#endif qmlRegisterUncreatableType<QQuickPaintedItem>("QtQuick", 2, 0, "PaintedItem", QQuickPaintedItem::tr("Cannot create instance of abstract class PaintedItem")); +#if QT_CONFIG(quick_canvas) qmlRegisterType<QQuickCanvasItem>("QtQuick", 2, 0, "Canvas"); +#endif +#if QT_CONFIG(quick_sprite) qmlRegisterType<QQuickSprite>("QtQuick", 2, 0, "Sprite"); qmlRegisterType<QQuickAnimatedSprite>("QtQuick", 2, 0, "AnimatedSprite"); qmlRegisterType<QQuickSpriteSequence>("QtQuick", 2, 0, "SpriteSequence"); +#endif qmlRegisterType<QQuickParentChange>(uri, major, minor,"ParentChange"); qmlRegisterType<QQuickAnchorChanges>(uri, major, minor,"AnchorChanges"); qmlRegisterType<QQuickAnchorSet>(); qmlRegisterType<QQuickAnchorAnimation>(uri, major, minor,"AnchorAnimation"); qmlRegisterType<QQuickParentAnimation>(uri, major, minor,"ParentAnimation"); +#if QT_CONFIG(quick_canvas) qmlRegisterType<QQuickPathAnimation>("QtQuick",2,0,"PathAnimation"); qmlRegisterType<QQuickPathInterpolator>("QtQuick",2,0,"PathInterpolator"); +#endif #ifndef QT_NO_DRAGANDDROP qmlRegisterType<QQuickDropArea>("QtQuick", 2, 0, "DropArea"); @@ -246,11 +294,19 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) #endif qmlRegisterType<QQuickItem, 1>(uri, 2, 1,"Item"); +#if QT_CONFIG(quick_positioners) qmlRegisterType<QQuickGrid, 1>(uri, 2, 1, "Grid"); +#endif +#if QT_CONFIG(quick_itemview) qmlRegisterUncreatableType<QQuickItemView, 1>(uri, 2, 1, "ItemView", QQuickItemView::tr("ItemView is an abstract base class")); qmlRegisterUncreatableType<QQuickItemView, 2>(uri, 2, 3, "ItemView", QQuickItemView::tr("ItemView is an abstract base class")); +#endif +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView, 1>(uri, 2, 1, "ListView"); +#endif +#if QT_CONFIG(quick_gridview) qmlRegisterType<QQuickGridView, 1>(uri, 2, 1, "GridView"); +#endif qmlRegisterType<QQuickTextEdit, 1>(uri, 2, 1, "TextEdit"); qmlRegisterType<QQuickText, 2>(uri, 2, 2, "Text"); @@ -261,9 +317,13 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickImage, 1>(uri, 2, 3,"Image"); qmlRegisterType<QQuickItem, 2>(uri, 2, 4, "Item"); +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView, 2>(uri, 2, 4, "ListView"); +#endif qmlRegisterType<QQuickMouseArea, 1>(uri, 2, 4, "MouseArea"); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickShaderEffect, 1>(uri, 2, 4, "ShaderEffect"); +#endif #ifndef QT_NO_OPENGL qmlRegisterUncreatableType<QQuickOpenGLInfo>(uri, 2, 4,"OpenGLInfo", QQuickOpenGLInfo::tr("OpenGLInfo is only available via attached properties")); @@ -275,26 +335,38 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickText, 6>(uri, 2, 6, "Text"); qmlRegisterType<QQuickTextEdit, 6>(uri, 2, 6, "TextEdit"); qmlRegisterType<QQuickTextInput, 6>(uri, 2, 6, "TextInput"); +#if QT_CONFIG(quick_positioners) qmlRegisterUncreatableType<QQuickBasePositioner, 6>(uri, 2, 6, "Positioner", QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); qmlRegisterType<QQuickColumn, 6>(uri, 2, 6, "Column"); qmlRegisterType<QQuickRow, 6>(uri, 2, 6, "Row"); qmlRegisterType<QQuickGrid, 6>(uri, 2, 6, "Grid"); qmlRegisterType<QQuickFlow, 6>(uri, 2, 6, "Flow"); +#endif qmlRegisterUncreatableType<QQuickEnterKeyAttached, 6>(uri, 2, 6, "EnterKey", QQuickEnterKeyAttached::tr("EnterKey is only available via attached properties")); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickShaderEffectSource, 1>(uri, 2, 6, "ShaderEffectSource"); +#endif +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView, 7>(uri, 2, 7, "ListView"); +#endif +#if QT_CONFIG(quick_gridview) qmlRegisterType<QQuickGridView, 7>(uri, 2, 7, "GridView"); +#endif qmlRegisterType<QQuickTextInput, 7>(uri, 2, 7, "TextInput"); qmlRegisterType<QQuickTextEdit, 7>(uri, 2, 7, "TextEdit"); +#if QT_CONFIG(quick_pathview) qmlRegisterType<QQuickPathView, 7>(uri, 2, 7, "PathView"); +#endif qmlRegisterUncreatableType<QQuickMouseEvent, 7>(uri, 2, 7, nullptr, QQuickMouseEvent::tr("MouseEvent is only available within handlers in MouseArea")); qmlRegisterUncreatableType<QQuickGraphicsInfo>(uri, 2, 8,"GraphicsInfo", QQuickGraphicsInfo::tr("GraphicsInfo is only available via attached properties")); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickBorderImageMesh>("QtQuick", 2, 8, "BorderImageMesh"); +#endif } static void initResources() diff --git a/src/quick/items/qquickitemview_p.h b/src/quick/items/qquickitemview_p.h index 1a28fc212b..c289ace408 100644 --- a/src/quick/items/qquickitemview_p.h +++ b/src/quick/items/qquickitemview_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <QtQuick/private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_itemview); + #include "qquickflickable_p.h" #include <qpointer.h> #include <QtCore/QLoggingCategory> diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index 0893d6e749..62851c9a89 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <QtQuick/private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_itemview); + #include "qquickitemview_p.h" #include "qquickitemviewtransition_p.h" #include "qquickflickable_p_p.h" diff --git a/src/quick/items/qquickitemviewtransition_p.h b/src/quick/items/qquickitemviewtransition_p.h index 6641dada29..ff0e82ac7b 100644 --- a/src/quick/items/qquickitemviewtransition_p.h +++ b/src/quick/items/qquickitemviewtransition_p.h @@ -52,6 +52,9 @@ // #include <QtQuick/private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_viewtransitions); + #include <QtCore/qobject.h> #include <QtCore/qpoint.h> #include <QtQml/qqml.h> diff --git a/src/quick/items/qquicklistview_p.h b/src/quick/items/qquicklistview_p.h index 5a5e8a55fe..8d0ad7f618 100644 --- a/src/quick/items/qquicklistview_p.h +++ b/src/quick/items/qquicklistview_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_listview); + #include "qquickitemview_p.h" #include <private/qtquickglobal_p.h> diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index 10e6afad33..6bd83dd808 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -43,6 +43,7 @@ #include "qquickdrag_p.h" #include <private/qqmldata_p.h> +#include <private/qsgadaptationlayer_p.h> #include <QtGui/private/qguiapplication_p.h> #include <QtGui/qevent.h> diff --git a/src/quick/items/qquickopenglshadereffect_p.h b/src/quick/items/qquickopenglshadereffect_p.h index ed56a76409..64e79a9343 100644 --- a/src/quick/items/qquickopenglshadereffect_p.h +++ b/src/quick/items/qquickopenglshadereffect_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_shadereffect); + #include <QtQuick/qquickitem.h> #include <QtQuick/qsgmaterial.h> diff --git a/src/quick/items/qquickopenglshadereffectnode_p.h b/src/quick/items/qquickopenglshadereffectnode_p.h index 5abe3ae3d0..aea28e6612 100644 --- a/src/quick/items/qquickopenglshadereffectnode_p.h +++ b/src/quick/items/qquickopenglshadereffectnode_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_shadereffect); + #include <QtQuick/qsgnode.h> #include <QtQuick/qsgmaterial.h> #include <QtQuick/qsgtextureprovider.h> diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp index d21eb93dbf..1ef8de753d 100644 --- a/src/quick/items/qquickpainteditem.cpp +++ b/src/quick/items/qquickpainteditem.cpp @@ -43,6 +43,7 @@ #include <QtQuick/private/qsgdefaultpainternode_p.h> #include <QtQuick/private/qsgcontext_p.h> #include <private/qsgadaptationlayer_p.h> +#include <qsgtextureprovider.h> #include <qmath.h> diff --git a/src/quick/items/qquickpathview_p.h b/src/quick/items/qquickpathview_p.h index bdd56b6311..a44d1be5c4 100644 --- a/src/quick/items/qquickpathview_p.h +++ b/src/quick/items/qquickpathview_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_pathview); + #include "qquickitem.h" #include <private/qtquickglobal_p.h> diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h index 0441603a4b..64abe3d1dc 100644 --- a/src/quick/items/qquickpathview_p_p.h +++ b/src/quick/items/qquickpathview_p_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_pathview); + #include "qquickpathview_p.h" #include "qquickitem_p.h" diff --git a/src/quick/items/qquickpositioners_p.h b/src/quick/items/qquickpositioners_p.h index f6388f111d..c25ecd6dbc 100644 --- a/src/quick/items/qquickpositioners_p.h +++ b/src/quick/items/qquickpositioners_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <QtQuick/private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_positioners); + #include "qquickimplicitsizeitem_p.h" #include "qquickitemviewtransition_p.h" diff --git a/src/quick/items/qquickpositioners_p_p.h b/src/quick/items/qquickpositioners_p_p.h index d18f9b3724..6dd84e6098 100644 --- a/src/quick/items/qquickpositioners_p_p.h +++ b/src/quick/items/qquickpositioners_p_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <QtQuick/private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_positioners); + #include "qquickpositioners_p.h" #include "qquickimplicitsizeitem_p_p.h" diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index 8b69447002..74aa2da9e0 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -47,8 +47,10 @@ #ifndef QT_NO_OPENGL # include <QtGui/QOpenGLContext> # include <QtQuick/private/qsgdefaultrendercontext_p.h> +#if QT_CONFIG(quick_shadereffect) # include <QtQuick/private/qquickopenglshadereffectnode_p.h> #endif +#endif #include <QtGui/private/qguiapplication_p.h> #include <qpa/qplatformintegration.h> @@ -190,7 +192,7 @@ void QQuickRenderControlPrivate::windowDestroyed() delete QQuickWindowPrivate::get(window)->animationController; QQuickWindowPrivate::get(window)->animationController = 0; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); #endif diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h index 17b009039a..2b7ff4cf6e 100644 --- a/src/quick/items/qquickshadereffect_p.h +++ b/src/quick/items/qquickshadereffect_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_shadereffect); + #include <QtQuick/qquickitem.h> #include <private/qtquickglobal_p.h> diff --git a/src/quick/items/qquickshadereffectmesh_p.h b/src/quick/items/qquickshadereffectmesh_p.h index c5f1d19866..cbf33b795f 100644 --- a/src/quick/items/qquickshadereffectmesh_p.h +++ b/src/quick/items/qquickshadereffectmesh_p.h @@ -37,6 +37,10 @@ ** ****************************************************************************/ +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_shadereffect); + #include "qqmlparserstatus.h" #include <QtQuick/qtquickglobal.h> diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h index ee18bf195a..5e7e354feb 100644 --- a/src/quick/items/qquickshadereffectsource_p.h +++ b/src/quick/items/qquickshadereffectsource_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <QtQuick/private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_shadereffect); + #include "qquickitem.h" #include <QtQuick/qsgtextureprovider.h> #include <private/qsgadaptationlayer_p.h> diff --git a/src/quick/items/qquicksprite_p.h b/src/quick/items/qquicksprite_p.h index 684d432f39..d68a45ecc0 100644 --- a/src/quick/items/qquicksprite_p.h +++ b/src/quick/items/qquicksprite_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include <QObject> #include <QUrl> #include <QVariantMap> @@ -325,4 +329,5 @@ private: }; QT_END_NAMESPACE + #endif // QQUICKSPRITE_P_H diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h index 485afc16e5..cf50cd2d84 100644 --- a/src/quick/items/qquickspriteengine_p.h +++ b/src/quick/items/qquickspriteengine_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include <QObject> #include <QVector> #include <QTimer> diff --git a/src/quick/items/qquickspritesequence_p.h b/src/quick/items/qquickspritesequence_p.h index 34af110a98..b80a8348aa 100644 --- a/src/quick/items/qquickspritesequence_p.h +++ b/src/quick/items/qquickspritesequence_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include <QtQuick/QQuickItem> #include <QTime> diff --git a/src/quick/items/qquickspritesequence_p_p.h b/src/quick/items/qquickspritesequence_p_p.h index 4f352b5b69..3579833116 100644 --- a/src/quick/items/qquickspritesequence_p_p.h +++ b/src/quick/items/qquickspritesequence_p_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include "qquickitem_p.h" #include "qquicksprite_p.h" diff --git a/src/quick/qtquickglobal.h b/src/quick/qtquickglobal.h index f6f8f42e7f..5e83c1db84 100644 --- a/src/quick/qtquickglobal.h +++ b/src/quick/qtquickglobal.h @@ -40,7 +40,9 @@ #ifndef QTQUICKGLOBAL_H #define QTQUICKGLOBAL_H -#include <QtCore/qglobal.h> +#include <QtQml/qtqmlglobal.h> +#include <QtGui/qtguiglobal.h> +#include <QtQuick/qtquick-config.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h index 3c313de0a1..f6376a6d17 100644 --- a/src/quick/qtquickglobal_p.h +++ b/src/quick/qtquickglobal_p.h @@ -40,6 +40,10 @@ #ifndef QTQUICKGLOBAL_P_H #define QTQUICKGLOBAL_P_H +#include <QtQml/private/qtqmlglobal_p.h> +#include <QtGui/private/qtguiglobal_p.h> +#include <QtQuick/private/qtquick-config_p.h> + #include <QtCore/qloggingcategory.h> // diff --git a/src/quick/quick.pro b/src/quick/quick.pro index 4909f7fce8..8f4f9a8290 100644 --- a/src/quick/quick.pro +++ b/src/quick/quick.pro @@ -1,12 +1,8 @@ TARGET = QtQuick QT = core-private gui-private qml-private -!no_network { - QT_PRIVATE = network -} -no_network { - DEFINES += QT_NO_NETWORK -} +qtConfig(qml-network): \ + QT_PRIVATE += network DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES win32-msvc*:DEFINES *= _CRT_SECURE_NO_WARNINGS @@ -32,7 +28,8 @@ ANDROID_BUNDLED_FILES += \ include(util/util.pri) include(scenegraph/scenegraph.pri) include(items/items.pri) -include(designer/designer.pri) +qtConfig(quick-designer): \ + include(designer/designer.pri) qtConfig(accessibility) { include(accessible/accessible.pri) } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp index 80112c1121..05d5daa686 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp @@ -47,7 +47,9 @@ #include "qsgsoftwarepublicnodes_p.h" #include "qsgsoftwarelayer_p.h" #include "qsgsoftwarerenderer_p.h" +#if QT_CONFIG(quick_sprite) #include "qsgsoftwarespritenode_p.h" +#endif #include <QtCore/QCoreApplication> #include <QtCore/QElapsedTimer> @@ -184,10 +186,12 @@ QSGNinePatchNode *QSGSoftwareContext::createNinePatchNode() return new QSGSoftwareNinePatchNode; } +#if QT_CONFIG(quick_sprite) QSGSpriteNode *QSGSoftwareContext::createSpriteNode() { return new QSGSoftwareSpriteNode; } +#endif QSGRendererInterface::GraphicsApi QSGSoftwareContext::graphicsApi() const { diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h index dcc137b4b4..1f14717416 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h @@ -98,7 +98,9 @@ public: QSGRectangleNode *createRectangleNode() override; QSGImageNode *createImageNode() override; QSGNinePatchNode *createNinePatchNode() override; +#if QT_CONFIG(quick_sprite) QSGSpriteNode *createSpriteNode() override; +#endif GraphicsApi graphicsApi() const override; ShaderType shaderType() const override; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp index 7b9e749532..59c47db0c4 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp @@ -45,7 +45,9 @@ #include "qsgsoftwarepublicnodes_p.h" #include "qsgsoftwarepainternode_p.h" #include "qsgsoftwarepixmaptexture_p.h" +#if QT_CONFIG(quick_sprite) #include "qsgsoftwarespritenode_p.h" +#endif #include <qsgsimplerectnode.h> #include <qsgsimpletexturenode.h> @@ -91,9 +93,11 @@ QSGSoftwareRenderableNode::QSGSoftwareRenderableNode(NodeType type, QSGNode *nod case QSGSoftwareRenderableNode::SimpleImage: m_handle.simpleImageNode = static_cast<QSGImageNode*>(node); break; +#if QT_CONFIG(quick_sprite) case QSGSoftwareRenderableNode::SpriteNode: m_handle.spriteNode = static_cast<QSGSoftwareSpriteNode*>(node); break; +#endif case QSGSoftwareRenderableNode::RenderNode: m_handle.renderNode = static_cast<QSGRenderNode*>(node); break; @@ -182,10 +186,12 @@ void QSGSoftwareRenderableNode::update() boundingRect = m_handle.simpleImageNode->rect().toRect(); break; +#if QT_CONFIG(quick_sprite) case QSGSoftwareRenderableNode::SpriteNode: m_isOpaque = m_handle.spriteNode->isOpaque(); boundingRect = m_handle.spriteNode->rect().toRect(); break; +#endif case QSGSoftwareRenderableNode::RenderNode: if (m_handle.renderNode->flags().testFlag(QSGRenderNode::OpaqueRendering) && !m_transform.isRotating()) m_isOpaque = true; @@ -317,9 +323,11 @@ QRegion QSGSoftwareRenderableNode::renderNode(QPainter *painter, bool forceOpaqu case QSGSoftwareRenderableNode::SimpleImage: static_cast<QSGSoftwareImageNode *>(m_handle.simpleImageNode)->paint(painter); break; +#if QT_CONFIG(quick_sprite) case QSGSoftwareRenderableNode::SpriteNode: static_cast<QSGSoftwareSpriteNode *>(m_handle.spriteNode)->paint(painter); break; +#endif default: break; } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h index 0626b1e657..473578c185 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h @@ -51,6 +51,8 @@ // We mean it. // +#include <QtQuick/private/qtquickglobal_p.h> + #include <QtGui/QRegion> #include <QtCore/QRect> #include <QtGui/QTransform> @@ -84,7 +86,9 @@ public: NinePatch, SimpleRectangle, SimpleImage, +#if QT_CONFIG(quick_sprite) SpriteNode, +#endif RenderNode }; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp index 12dbf63353..4937565aa9 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp @@ -181,6 +181,7 @@ void QSGSoftwareRenderableNodeUpdater::endVisit(QSGRootNode *) { } +#if QT_CONFIG(quick_sprite) bool QSGSoftwareRenderableNodeUpdater::visit(QSGSpriteNode *node) { return updateRenderableNode(QSGSoftwareRenderableNode::SpriteNode, node); @@ -190,6 +191,7 @@ void QSGSoftwareRenderableNodeUpdater::endVisit(QSGSpriteNode *) { } +#endif bool QSGSoftwareRenderableNodeUpdater::visit(QSGRenderNode *node) { diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h index f204867236..ca16f77c22 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h @@ -86,8 +86,10 @@ public: void endVisit(QSGGlyphNode *) override; bool visit(QSGRootNode *) override; void endVisit(QSGRootNode *) override; +#if QT_CONFIG(quick_sprite) bool visit(QSGSpriteNode *) override; void endVisit(QSGSpriteNode *) override; +#endif bool visit(QSGRenderNode *) override; void endVisit(QSGRenderNode *) override; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp index 4e34517dad..70dce71801 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp @@ -141,6 +141,7 @@ void QSGSoftwareRenderListBuilder::endVisit(QSGRootNode *) { } +#if QT_CONFIG(quick_sprite) bool QSGSoftwareRenderListBuilder::visit(QSGSpriteNode *node) { return addRenderableNode(node); @@ -150,6 +151,7 @@ void QSGSoftwareRenderListBuilder::endVisit(QSGSpriteNode *) { } +#endif bool QSGSoftwareRenderListBuilder::visit(QSGRenderNode *node) { diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h index 807cb7fdbe..f5db30269f 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h @@ -80,8 +80,10 @@ public: void endVisit(QSGGlyphNode *) override; bool visit(QSGRootNode *) override; void endVisit(QSGRootNode *) override; +#if QT_CONFIG(quick_sprite) bool visit(QSGSpriteNode *) override; void endVisit(QSGSpriteNode *) override; +#endif bool visit(QSGRenderNode *) override; void endVisit(QSGRenderNode *) override; diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h index 284ed3dff5..577a30c051 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include <private/qsgadaptationlayer_p.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/scenegraph/adaptations/software/software.pri b/src/quick/scenegraph/adaptations/software/software.pri index 97644fc36a..de5f01cdee 100644 --- a/src/quick/scenegraph/adaptations/software/software.pri +++ b/src/quick/scenegraph/adaptations/software/software.pri @@ -19,7 +19,6 @@ SOURCES += \ $$PWD/qsgsoftwarerenderloop.cpp \ $$PWD/qsgsoftwarelayer.cpp \ $$PWD/qsgsoftwareadaptation.cpp \ - $$PWD/qsgsoftwarespritenode.cpp \ $$PWD/qsgsoftwarethreadedrenderloop.cpp HEADERS += \ @@ -39,5 +38,11 @@ HEADERS += \ $$PWD/qsgsoftwarerenderloop_p.h \ $$PWD/qsgsoftwarelayer_p.h \ $$PWD/qsgsoftwareadaptation_p.h \ - $$PWD/qsgsoftwarespritenode_p.h \ $$PWD/qsgsoftwarethreadedrenderloop_p.h + +qtConfig(quick-sprite) { + SOURCES += \ + $$PWD/qsgsoftwarespritenode.cpp + HEADERS += \ + $$PWD/qsgsoftwarespritenode_p.h +} diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h index a74b38dba8..5880c67af0 100644 --- a/src/quick/scenegraph/qsgadaptationlayer_p.h +++ b/src/quick/scenegraph/qsgadaptationlayer_p.h @@ -108,8 +108,10 @@ public: virtual void endVisit(QSGGlyphNode *) = 0; virtual bool visit(QSGRootNode *) = 0; virtual void endVisit(QSGRootNode *) = 0; +#if QT_CONFIG(quick_sprite) virtual bool visit(QSGSpriteNode *) = 0; virtual void endVisit(QSGSpriteNode *) = 0; +#endif virtual bool visit(QSGRenderNode *) = 0; virtual void endVisit(QSGRenderNode *) = 0; @@ -213,6 +215,8 @@ Q_SIGNALS: void scheduledUpdateCompleted(); }; +#if QT_CONFIG(quick_sprite) + class Q_QUICK_PRIVATE_EXPORT QSGSpriteNode : public QSGVisitableNode { public: @@ -230,6 +234,8 @@ public: virtual void accept(QSGNodeVisitorEx *visitor) { if (visitor->visit(this)) visitor->visitChildren(this); visitor->endVisit(this); } }; +#endif + class Q_QUICK_PRIVATE_EXPORT QSGGuiThreadShaderEffectManager : public QObject { Q_OBJECT diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index 899278843e..6b9db105e7 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -178,7 +178,9 @@ public: virtual QSGGuiThreadShaderEffectManager *createGuiThreadShaderEffectManager(); virtual QSGShaderEffectNode *createShaderEffectNode(QSGRenderContext *renderContext, QSGGuiThreadShaderEffectManager *mgr); +#if QT_CONFIG(quick_sprite) virtual QSGSpriteNode *createSpriteNode() = 0; +#endif virtual QAnimationDriver *createAnimationDriver(QObject *parent); virtual QSize minimumFBOSize() const; diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp index 6964b74dc8..405f1d86a4 100644 --- a/src/quick/scenegraph/qsgdefaultcontext.cpp +++ b/src/quick/scenegraph/qsgdefaultcontext.cpp @@ -52,7 +52,9 @@ #include <QtQuick/private/qsgdefaultrectanglenode_p.h> #include <QtQuick/private/qsgdefaultimagenode_p.h> #include <QtQuick/private/qsgdefaultninepatchnode_p.h> +#if QT_CONFIG(quick_sprite) #include <QtQuick/private/qsgdefaultspritenode_p.h> +#endif #include <QtGui/QOpenGLContext> #include <QtGui/QOpenGLFramebufferObject> @@ -258,10 +260,12 @@ QSGNinePatchNode *QSGDefaultContext::createNinePatchNode() return new QSGDefaultNinePatchNode; } +#if QT_CONFIG(quick_sprite) QSGSpriteNode *QSGDefaultContext::createSpriteNode() { return new QSGDefaultSpriteNode; } +#endif QSGRendererInterface::GraphicsApi QSGDefaultContext::graphicsApi() const { diff --git a/src/quick/scenegraph/qsgdefaultcontext_p.h b/src/quick/scenegraph/qsgdefaultcontext_p.h index 88db5e1e9a..ab319502ef 100644 --- a/src/quick/scenegraph/qsgdefaultcontext_p.h +++ b/src/quick/scenegraph/qsgdefaultcontext_p.h @@ -76,7 +76,9 @@ public: QSGRectangleNode *createRectangleNode() override; QSGImageNode *createImageNode() override; QSGNinePatchNode *createNinePatchNode() override; +#if QT_CONFIG(quick_sprite) QSGSpriteNode *createSpriteNode() override; +#endif void setDistanceFieldEnabled(bool enabled); bool isDistanceFieldEnabled() const; diff --git a/src/quick/scenegraph/qsgdefaultspritenode_p.h b/src/quick/scenegraph/qsgdefaultspritenode_p.h index cb76bf8d83..78aa8cc0cf 100644 --- a/src/quick/scenegraph/qsgdefaultspritenode_p.h +++ b/src/quick/scenegraph/qsgdefaultspritenode_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_sprite); + #include <private/qsgadaptationlayer_p.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index e99e8dfe2e..df7bbe6ceb 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -61,8 +61,10 @@ #ifndef QT_NO_OPENGL # include <QtGui/QOpenGLContext> # include <private/qsgdefaultrendercontext_p.h> +#if QT_CONFIG(quick_shadereffect) # include <private/qquickopenglshadereffectnode_p.h> #endif +#endif #ifdef Q_OS_WIN # include <QtCore/qt_windows.h> @@ -326,7 +328,7 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window) if (Q_UNLIKELY(!current)) qCDebug(QSG_LOG_RENDERLOOP) << "cleanup without an OpenGL context"; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); #endif diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 6b9c67b2bd..693012154e 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -63,7 +63,9 @@ #include <private/qqmldebugserviceinterfaces_p.h> #include <private/qqmldebugconnector_p.h> +#if QT_CONFIG(quick_shadereffect) #include <private/qquickopenglshadereffectnode_p.h> +#endif #include <private/qsgdefaultrendercontext_p.h> /* @@ -487,7 +489,9 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor, QQuickWindowPrivate *dd = QQuickWindowPrivate::get(window); +#if QT_CONFIG(quick_shadereffect) QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); +#endif // The canvas nodes must be cleaned up regardless if we are in the destructor.. if (wipeSG) { diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 743e524a36..941a7b3f3c 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -55,7 +55,7 @@ #include <private/qquickprofiler_p.h> #include <private/qquickanimatorcontroller_p.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) #include <private/qquickopenglshadereffectnode_p.h> #endif @@ -245,7 +245,7 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window) if (Q_UNLIKELY(!current)) qCDebug(QSG_LOG_RENDERLOOP) << "cleanup without an OpenGL context"; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache(); #endif diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri index a659ca5e10..edf4aa08c5 100644 --- a/src/quick/scenegraph/scenegraph.pri +++ b/src/quick/scenegraph/scenegraph.pri @@ -113,7 +113,6 @@ qtConfig(opengl(es1|es2)?) { $$PWD/qsgdefaultinternalrectanglenode.cpp \ $$PWD/qsgdefaultrendercontext.cpp \ $$PWD/qsgdefaultcontext.cpp \ - $$PWD/qsgdefaultspritenode.cpp \ $$PWD/util/qsgdefaultpainternode.cpp \ $$PWD/util/qsgdefaultrectanglenode.cpp \ $$PWD/util/qsgdefaultimagenode.cpp \ @@ -129,7 +128,6 @@ qtConfig(opengl(es1|es2)?) { $$PWD/qsgdefaultglyphnode_p_p.h \ $$PWD/qsgdefaultinternalimagenode_p.h \ $$PWD/qsgdefaultinternalrectanglenode_p.h \ - $$PWD/qsgdefaultspritenode_p.h \ $$PWD/qsgdefaultrendercontext_p.h \ $$PWD/qsgdefaultcontext_p.h \ $$PWD/util/qsgdefaultpainternode_p.h \ @@ -139,6 +137,13 @@ qtConfig(opengl(es1|es2)?) { $$PWD/qsgdefaultlayer_p.h \ $$PWD/qsgthreadedrenderloop_p.h \ $$PWD/qsgwindowsrenderloop_p.h + + qtConfig(quick-sprite) { + SOURCES += \ + $$PWD/qsgdefaultspritenode.cpp + HEADERS += \ + $$PWD/qsgdefaultspritenode_p.h + } } # Built-in, non-plugin-based adaptations diff --git a/src/quick/util/qquickanimator.cpp b/src/quick/util/qquickanimator.cpp index 100b7bd402..5d2af0f940 100644 --- a/src/quick/util/qquickanimator.cpp +++ b/src/quick/util/qquickanimator.cpp @@ -502,7 +502,8 @@ QQuickRotationAnimator::RotationDirection QQuickRotationAnimator::direction() co Q_D(const QQuickRotationAnimator); return d->direction; } -#ifndef QT_NO_OPENGL + +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) /*! \qmltype UniformAnimator \instantiates QQuickUniformAnimator diff --git a/src/quick/util/qquickanimator_p.h b/src/quick/util/qquickanimator_p.h index f1e2d4e1d9..0fc900c5ac 100644 --- a/src/quick/util/qquickanimator_p.h +++ b/src/quick/util/qquickanimator_p.h @@ -169,7 +169,8 @@ protected: QQuickAnimatorJob *createJob() const; QString propertyName() const { return QStringLiteral("rotation"); } }; -#ifndef QT_NO_OPENGL + +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) class QQuickUniformAnimatorPrivate; class Q_QUICK_PRIVATE_EXPORT QQuickUniformAnimator : public QQuickAnimator { @@ -200,7 +201,7 @@ QML_DECLARE_TYPE(QQuickYAnimator) QML_DECLARE_TYPE(QQuickScaleAnimator) QML_DECLARE_TYPE(QQuickRotationAnimator) QML_DECLARE_TYPE(QQuickOpacityAnimator) -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) QML_DECLARE_TYPE(QQuickUniformAnimator) #endif #endif // QQUICKANIMATOR_P_H diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp index a0c787dae5..1176cf1ff7 100644 --- a/src/quick/util/qquickanimatorjob.cpp +++ b/src/quick/util/qquickanimatorjob.cpp @@ -43,7 +43,7 @@ #include "qquickanimator_p_p.h" #include <private/qquickwindow_p.h> #include <private/qquickitem_p.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) # include <private/qquickopenglshadereffectnode_p.h> # include <private/qquickopenglshadereffect_p.h> #endif @@ -329,11 +329,13 @@ void QQuickTransformAnimatorJob::Helper::sync() | QQuickItemPrivate::Size; QQuickItemPrivate *d = QQuickItemPrivate::get(item); +#if QT_CONFIG(quick_shadereffect) if (d->extra.isAllocated() && d->extra->layer && d->extra->layer->enabled()) { d = QQuickItemPrivate::get(d->extra->layer->m_effectSource); } +#endif quint32 dirty = mask & d->dirtyAttributes; @@ -423,11 +425,13 @@ void QQuickOpacityAnimatorJob::initialize(QQuickAnimatorController *controller) { QQuickAnimatorJob::initialize(controller); QQuickItemPrivate *d = QQuickItemPrivate::get(m_target); +#if QT_CONFIG(quick_shadereffect) if (d->extra.isAllocated() && d->extra->layer && d->extra->layer->enabled()) { d = QQuickItemPrivate::get(d->extra->layer->m_effectSource); } +#endif m_opacityNode = d->opacityNode(); if (!m_opacityNode) { @@ -543,7 +547,7 @@ void QQuickRotationAnimatorJob::writeBack() m_target->setRotation(value()); } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) QQuickUniformAnimatorJob::QQuickUniformAnimatorJob() : m_node(0) , m_uniformIndex(-1) diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp index 6e23d99f7e..d13291c30a 100644 --- a/src/quick/util/qquickfontloader.cpp +++ b/src/quick/util/qquickfontloader.cpp @@ -52,7 +52,7 @@ #include <qqmlinfo.h> #include <qqmlfile.h> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include <QNetworkRequest> #include <QNetworkReply> #endif @@ -70,7 +70,7 @@ Q_OBJECT public: explicit QQuickFontObject(int _id = -1); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void download(const QUrl &url, QNetworkAccessManager *manager); Q_SIGNALS: @@ -82,7 +82,7 @@ private: private Q_SLOTS: void replyFinished(); -#endif // QT_NO_NETWORK +#endif // qml_network public: int id; @@ -92,7 +92,7 @@ public: QQuickFontObject::QQuickFontObject(int _id) : QObject(0) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) ,redirectCount(0), reply(0) #endif ,id(_id) @@ -100,7 +100,7 @@ QQuickFontObject::QQuickFontObject(int _id) } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void QQuickFontObject::download(const QUrl &url, QNetworkAccessManager *manager) { QNetworkRequest req(url); @@ -141,7 +141,7 @@ void QQuickFontObject::replyFinished() reply = 0; } } -#endif // QT_NO_NETWORK +#endif // qml_network class QQuickFontLoaderPrivate : public QObjectPrivate { @@ -268,7 +268,7 @@ void QQuickFontLoader::setSource(const QUrl &url) } } else { if (!fontLoaderFonts()->map.contains(d->url)) { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QQuickFontObject *fo = new QQuickFontObject; fontLoaderFonts()->map[d->url] = fo; fo->download(d->url, qmlEngine(this)->networkAccessManager()); @@ -282,7 +282,7 @@ void QQuickFontLoader::setSource(const QUrl &url) } else { QQuickFontObject *fo = fontLoaderFonts()->map.value(d->url); if (fo->id == -1) { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) d->status = Loading; emit statusChanged(); QObject::connect(fo, SIGNAL(fontDownloaded(QString,QQuickFontLoader::Status)), diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h index fa6cbc668a..457f69d20f 100644 --- a/src/quick/util/qquickpath_p.h +++ b/src/quick/util/qquickpath_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_path); + #include <qqml.h> #include <private/qqmlnullablevalue_p.h> diff --git a/src/quick/util/qquickpath_p_p.h b/src/quick/util/qquickpath_p_p.h index 3e4ccc7eb6..1dc3c1c47a 100644 --- a/src/quick/util/qquickpath_p_p.h +++ b/src/quick/util/qquickpath_p_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_path); + #include "qquickpath_p.h" #include <qqml.h> diff --git a/src/quick/util/qquickpathinterpolator_p.h b/src/quick/util/qquickpathinterpolator_p.h index ce18190977..0fdb1a444f 100644 --- a/src/quick/util/qquickpathinterpolator_p.h +++ b/src/quick/util/qquickpathinterpolator_p.h @@ -51,6 +51,10 @@ // We mean it. // +#include <private/qtquickglobal_p.h> + +QT_REQUIRE_CONFIG(quick_path); + #include <qqml.h> #include <QObject> diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index d151c43f7a..96b88636fe 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -67,7 +67,7 @@ #include <QQmlFile> #include <QMetaMethod> -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) #include <qqmlnetworkaccessmanagerfactory.h> #include <QNetworkReply> #include <QSslError> @@ -206,7 +206,7 @@ private: friend class QQuickPixmapReaderThreadObject; void processJobs(); void processJob(QQuickPixmapReply *, const QUrl &, const QString &, AutoTransform, QQuickImageProvider::ImageType, QQuickImageProvider *); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void networkRequestDone(QNetworkReply *); #endif void asyncResponseFinished(QQuickImageResponse *); @@ -220,7 +220,7 @@ private: QQuickPixmapReaderThreadObject *threadObject; QWaitCondition waitCondition; -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *networkAccessManager(); QNetworkAccessManager *accessManager; QHash<QNetworkReply*,QQuickPixmapReply*> networkJobs; @@ -349,7 +349,7 @@ QQuickPixmapReply::Event::~Event() delete textureFactory; } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkAccessManager *QQuickPixmapReader::networkAccessManager() { if (!accessManager) { @@ -430,7 +430,7 @@ static bool readImage(const QUrl& url, QIODevice *dev, QImage *image, QString *e QQuickPixmapReader::QQuickPixmapReader(QQmlEngine *eng) : QThread(eng), engine(eng), threadObject(0) -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) , accessManager(0) #endif { @@ -454,7 +454,7 @@ QQuickPixmapReader::~QQuickPixmapReader() delete reply; } jobs.clear(); -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) const auto cancelJob = [this](QQuickPixmapReply *reply) { if (reply->loading) { @@ -476,7 +476,7 @@ QQuickPixmapReader::~QQuickPixmapReader() wait(); } -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) void QQuickPixmapReader::networkRequestDone(QNetworkReply *reply) { QQuickPixmapReply *job = networkJobs.take(reply); @@ -526,7 +526,7 @@ void QQuickPixmapReader::networkRequestDone(QNetworkReply *reply) // kick off event loop again incase we have dropped below max request count threadObject->processJobs(); } -#endif // QT_NO_NETWORK +#endif // qml_network void QQuickPixmapReader::asyncResponseFinished(QQuickImageResponse *response) { @@ -577,7 +577,7 @@ bool QQuickPixmapReaderThreadObject::event(QEvent *e) void QQuickPixmapReaderThreadObject::networkRequestDone() { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) QNetworkReply *reply = static_cast<QNetworkReply *>(sender()); reader->networkRequestDone(reply); #endif @@ -599,7 +599,7 @@ void QQuickPixmapReader::processJobs() // Clean cancelled jobs if (!cancelled.isEmpty()) { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) for (int i = 0; i < cancelled.count(); ++i) { QQuickPixmapReply *job = cancelled.at(i); QNetworkReply *reply = networkJobs.key(job, 0); @@ -643,7 +643,7 @@ void QQuickPixmapReader::processJobs() } else { localFile = QQmlFile::urlToLocalFileOrQrc(url); usableJob = !localFile.isEmpty() -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) || networkJobs.count() < IMAGEREQUEST_MAX_NETWORK_REQUEST_COUNT #endif ; @@ -771,7 +771,7 @@ void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &u runningJob->postReply(errorCode, errorStr, readSize, QQuickTextureFactory::textureFactoryForImage(image)); mutex.unlock(); } else { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) // Network resource QNetworkRequest req(url); req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); @@ -840,7 +840,7 @@ void QQuickPixmapReader::cancel(QQuickPixmapReply *reply) void QQuickPixmapReader::run() { if (replyDownloadProgress == -1) { -#ifndef QT_NO_NETWORK +#if QT_CONFIG(qml_network) replyDownloadProgress = QMetaMethod::fromSignal(&QNetworkReply::downloadProgress).methodIndex(); replyFinished = QMetaMethod::fromSignal(&QNetworkReply::finished).methodIndex(); const QMetaObject *ir = &QQuickPixmapReaderThreadObject::staticMetaObject; diff --git a/src/quick/util/qquickutilmodule.cpp b/src/quick/util/qquickutilmodule.cpp index 66994e22ba..7e2973a78b 100644 --- a/src/quick/util/qquickutilmodule.cpp +++ b/src/quick/util/qquickutilmodule.cpp @@ -107,7 +107,7 @@ void QQuickUtilModule::defineModule() qmlRegisterType<QQuickScaleAnimator>("QtQuick", 2, 2, "ScaleAnimator"); qmlRegisterType<QQuickRotationAnimator>("QtQuick", 2, 2, "RotationAnimator"); qmlRegisterType<QQuickOpacityAnimator>("QtQuick", 2, 2, "OpacityAnimator"); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) qmlRegisterType<QQuickUniformAnimator>("QtQuick", 2, 2, "UniformAnimator"); #endif qmlRegisterType<QQuickStateOperation>(); diff --git a/src/quick/util/util.pri b/src/quick/util/util.pri index 66792536d7..1ef1018a31 100644 --- a/src/quick/util/util.pri +++ b/src/quick/util/util.pri @@ -17,8 +17,6 @@ SOURCES += \ $$PWD/qquickbehavior.cpp \ $$PWD/qquickfontloader.cpp \ $$PWD/qquickstyledtext.cpp \ - $$PWD/qquickpath.cpp \ - $$PWD/qquickpathinterpolator.cpp \ $$PWD/qquickimageprovider.cpp \ $$PWD/qquicksvgparser.cpp \ $$PWD/qquickvaluetypes.cpp \ @@ -55,9 +53,6 @@ HEADERS += \ $$PWD/qquickbehavior_p.h \ $$PWD/qquickfontloader_p.h \ $$PWD/qquickstyledtext_p.h \ - $$PWD/qquickpath_p.h \ - $$PWD/qquickpath_p_p.h \ - $$PWD/qquickpathinterpolator_p.h \ $$PWD/qquickimageprovider.h \ $$PWD/qquicksvgparser_p.h \ $$PWD/qquickvaluetypes_p.h \ @@ -70,3 +65,13 @@ HEADERS += \ $$PWD/qquicktextmetrics_p.h \ $$PWD/qquickshortcut_p.h \ $$PWD/qquickvalidator_p.h + +qtConfig(quick-path) { + SOURCES += \ + $$PWD/qquickpath.cpp \ + $$PWD/qquickpathinterpolator.cpp + HEADERS += \ + $$PWD/qquickpath_p.h \ + $$PWD/qquickpath_p_p.h \ + $$PWD/qquickpathinterpolator_p.h +} diff --git a/src/src.pro b/src/src.pro index 11bc4de8e3..f585ef15ca 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,5 +1,7 @@ TEMPLATE = subdirs CONFIG += ordered +include($$OUT_PWD/quick/qtquick-config.pri) +QT_FOR_CONFIG += quick-private SUBDIRS += \ qml @@ -8,7 +10,8 @@ qtHaveModule(gui) { quick \ qmltest - qtConfig(opengl(es1|es2)?): SUBDIRS += particles + qtConfig(quick-sprite):qtConfig(opengl(es1|es2)?): \ + SUBDIRS += particles qtHaveModule(widgets): SUBDIRS += quickwidgets } |