aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/imports/folderlistmodel/fileinfothread.cpp14
-rw-r--r--src/imports/folderlistmodel/fileinfothread_p.h2
-rw-r--r--src/imports/folderlistmodel/plugin.cpp1
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp27
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.h3
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp12
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.h9
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmldebuggerservicefactory.cpp4
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp11
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h5
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp26
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h2
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp41
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h3
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp20
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h10
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservicefactory.cpp4
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp86
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h20
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp55
-rw-r--r--src/qml/debugger/qqmldebug.cpp81
-rw-r--r--src/qml/debugger/qqmldebug.h7
-rw-r--r--src/qml/debugger/qqmldebugserviceinterfaces.cpp2
-rw-r--r--src/qml/debugger/qqmldebugserviceinterfaces_p.h39
-rw-r--r--src/qml/debugger/qqmlprofilerdefinitions_p.h4
-rw-r--r--src/qml/jsruntime/qv4debugging_p.h1
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp3
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp25
-rw-r--r--src/qml/qml/qqmlboundsignal_p.h4
-rw-r--r--src/qml/qml/qqmlengine.cpp1
-rw-r--r--src/qml/qml/qqmlimport.cpp14
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp7
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp6
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp2
-rw-r--r--src/qml/types/qqmlconnections.cpp31
-rw-r--r--src/qml/types/qqmlconnections_p.h5
-rw-r--r--src/quick/items/qquickitem.cpp4
-rw-r--r--src/quick/items/qquicklistview.cpp47
-rw-r--r--src/quick/items/qquickloader.cpp18
-rw-r--r--src/quick/items/qquicktext.cpp4
-rw-r--r--src/quick/items/qquicktextedit_p_p.h4
-rw-r--r--src/quick/items/qquicktextinput_p_p.h4
-rw-r--r--src/quick/items/qquicktextnode_p.h2
-rw-r--r--src/quick/util/qquickanimatorjob.cpp3
44 files changed, 472 insertions, 201 deletions
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp
index ebdfba42a8..731eb45460 100644
--- a/src/imports/folderlistmodel/fileinfothread.cpp
+++ b/src/imports/folderlistmodel/fileinfothread.cpp
@@ -52,7 +52,8 @@ FileInfoThread::FileInfoThread(QObject *parent)
showDirsFirst(false),
showDotAndDotDot(false),
showHidden(false),
- showOnlyReadable(false)
+ showOnlyReadable(false),
+ caseSensitive(true)
{
#ifndef QT_NO_FILESYSTEMWATCHER
watcher = new QFileSystemWatcher(this);
@@ -190,6 +191,14 @@ void FileInfoThread::setShowOnlyReadable(bool on)
condition.wakeAll();
}
+void FileInfoThread::setCaseSensitive(bool on)
+{
+ QMutexLocker locker(&mutex);
+ caseSensitive = on;
+ folderUpdate = true;
+ condition.wakeAll();
+}
+
#ifndef QT_NO_FILESYSTEMWATCHER
void FileInfoThread::updateFile(const QString &path)
{
@@ -228,7 +237,8 @@ void FileInfoThread::run()
void FileInfoThread::getFileInfos(const QString &path)
{
QDir::Filters filter;
- filter = QDir::CaseSensitive;
+ if (caseSensitive)
+ filter = QDir::CaseSensitive;
if (showFiles)
filter = filter | QDir::Files;
if (showDirs)
diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h
index b375584ff8..5f62f39a20 100644
--- a/src/imports/folderlistmodel/fileinfothread_p.h
+++ b/src/imports/folderlistmodel/fileinfothread_p.h
@@ -79,6 +79,7 @@ public:
void setShowDotAndDotDot(bool on);
void setShowHidden(bool on);
void setShowOnlyReadable(bool on);
+ void setCaseSensitive(bool on);
public Q_SLOTS:
#ifndef QT_NO_FILESYSTEMWATCHER
@@ -113,6 +114,7 @@ private:
bool showDotAndDotDot;
bool showHidden;
bool showOnlyReadable;
+ bool caseSensitive;
};
#endif // FILEINFOTHREAD_P_H
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp
index a2536bdc7d..7280fcd1dc 100644
--- a/src/imports/folderlistmodel/plugin.cpp
+++ b/src/imports/folderlistmodel/plugin.cpp
@@ -52,6 +52,7 @@ public:
qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel");
qmlRegisterType<QQuickFolderListModel>(uri,2,0,"FolderListModel");
qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel");
+ qmlRegisterType<QQuickFolderListModel,2>(uri,2,2,"FolderListModel");
#endif
}
};
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 8bfbf09769..839e0f42c7 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -49,7 +49,7 @@ public:
: q_ptr(q),
sortField(QQuickFolderListModel::Name), sortReversed(false), showFiles(true),
showDirs(true), showDirsFirst(false), showDotAndDotDot(false), showOnlyReadable(false),
- showHidden(false)
+ showHidden(false), caseSensitive(true)
{
nameFilters << QLatin1String("*");
}
@@ -70,6 +70,7 @@ public:
bool showDotAndDotDot;
bool showOnlyReadable;
bool showHidden;
+ bool caseSensitive;
~QQuickFolderListModelPrivate() {}
void init();
@@ -762,6 +763,30 @@ void QQuickFolderListModel::setShowOnlyReadable(bool on)
}
/*!
+ * \qmlproperty bool FolderListModel::caseSensitive
+ * \since 5.7
+ *
+ * Use case sensitive pattern matching.
+ *
+ * By default, this property is true.
+ *
+ */
+bool QQuickFolderListModel::caseSensitive() const
+{
+ Q_D(const QQuickFolderListModel);
+ return d->caseSensitive;
+}
+
+void QQuickFolderListModel::setCaseSensitive(bool on)
+{
+ Q_D(QQuickFolderListModel);
+
+ if (on != d->caseSensitive) {
+ d->fileInfoThread.setCaseSensitive(on);
+ }
+}
+
+/*!
\qmlmethod var FolderListModel::get(int index, string property)
Get the folder property for the given index. The following properties
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h
index fcfec56c87..4b540742b4 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.h
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h
@@ -67,6 +67,7 @@ class QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus
Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot)
Q_PROPERTY(bool showHidden READ showHidden WRITE setShowHidden REVISION 1)
Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable)
+ Q_PROPERTY(bool caseSensitive READ caseSensitive WRITE setCaseSensitive REVISION 2)
Q_PROPERTY(int count READ count NOTIFY countChanged)
//![class props]
@@ -128,6 +129,8 @@ public:
void setShowHidden(bool on);
bool showOnlyReadable() const;
void setShowOnlyReadable(bool on);
+ bool caseSensitive() const;
+ void setCaseSensitive(bool on);
//![prop funcs]
Q_INVOKABLE bool isFolder(int index) const;
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp
index 6bccec08b1..ee1047d2b0 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.cpp
@@ -38,16 +38,14 @@
QT_BEGIN_NAMESPACE
-const QString QDebugMessageService::s_key = QStringLiteral("DebugMessages");
-
void DebugMessageHandler(QtMsgType type, const QMessageLogContext &ctxt,
const QString &buf)
{
- QQmlDebugConnector::service<QDebugMessageService>()->sendDebugMessage(type, ctxt, buf);
+ QQmlDebugConnector::service<QDebugMessageServiceImpl>()->sendDebugMessage(type, ctxt, buf);
}
-QDebugMessageService::QDebugMessageService(QObject *parent) :
- QQmlDebugService(s_key, 2, parent), oldMsgHandler(0),
+QDebugMessageServiceImpl::QDebugMessageServiceImpl(QObject *parent) :
+ QDebugMessageService(2, parent), oldMsgHandler(0),
prevState(QQmlDebugService::NotConnected)
{
// don't execute stateChanged() in parallel
@@ -58,7 +56,7 @@ QDebugMessageService::QDebugMessageService(QObject *parent) :
}
}
-void QDebugMessageService::sendDebugMessage(QtMsgType type,
+void QDebugMessageServiceImpl::sendDebugMessage(QtMsgType type,
const QMessageLogContext &ctxt,
const QString &buf)
{
@@ -76,7 +74,7 @@ void QDebugMessageService::sendDebugMessage(QtMsgType type,
(*oldMsgHandler)(type, ctxt, buf);
}
-void QDebugMessageService::stateChanged(State state)
+void QDebugMessageServiceImpl::stateChanged(State state)
{
QMutexLocker lock(&initMutex);
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.h b/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.h
index c0dc41bcd0..04f5966dd7 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qdebugmessageservice.h
@@ -45,7 +45,7 @@
// We mean it.
//
-#include <private/qqmldebugservice_p.h>
+#include <private/qqmldebugserviceinterfaces_p.h>
#include <QtCore/qlogging.h>
#include <QtCore/qmutex.h>
@@ -54,22 +54,19 @@ QT_BEGIN_NAMESPACE
class QDebugMessageServicePrivate;
-class QDebugMessageService : public QQmlDebugService
+class QDebugMessageServiceImpl : public QDebugMessageService
{
Q_OBJECT
public:
- QDebugMessageService(QObject *parent = 0);
+ QDebugMessageServiceImpl(QObject *parent = 0);
void sendDebugMessage(QtMsgType type, const QMessageLogContext &ctxt,
const QString &buf);
protected:
- static const QString s_key;
-
void stateChanged(State);
private:
- friend class QQmlDebugConnector;
friend class QQmlDebuggerServiceFactory;
QtMessageHandler oldMsgHandler;
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmldebuggerservicefactory.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmldebuggerservicefactory.cpp
index 7ba2aeecb0..ac3b435350 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmldebuggerservicefactory.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmldebuggerservicefactory.cpp
@@ -41,8 +41,8 @@ QT_BEGIN_NAMESPACE
QQmlDebugService *QQmlDebuggerServiceFactory::create(const QString &key)
{
- if (key == QDebugMessageService::s_key)
- return new QDebugMessageService(this);
+ if (key == QDebugMessageServiceImpl::s_key)
+ return new QDebugMessageServiceImpl(this);
if (key == QQmlEngineDebugServiceImpl::s_key)
return new QQmlEngineDebugServiceImpl(this);
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index db8c1feb92..b13c469893 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -344,23 +344,22 @@ const QString &ExpressionEvalJob::exceptionMessage() const
return exception;
}
-GatherSourcesJob::GatherSourcesJob(QV4::ExecutionEngine *engine, int seq)
+GatherSourcesJob::GatherSourcesJob(QV4::ExecutionEngine *engine)
: engine(engine)
- , seq(seq)
{}
void GatherSourcesJob::run()
{
- QStringList sources;
-
foreach (QV4::CompiledData::CompilationUnit *unit, engine->compilationUnits) {
QString fileName = unit->fileName();
if (!fileName.isEmpty())
sources.append(fileName);
}
+}
- QV4::Debugging::Debugger *debugger = engine->debugger;
- emit debugger->sourcesCollected(debugger, sources, seq);
+const QStringList &GatherSourcesJob::result() const
+{
+ return sources;
}
ArgumentCollectJob::ArgumentCollectJob(QV4::ExecutionEngine *engine, QV4DataCollector *collector,
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
index fb78c1614a..39d621e95e 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
@@ -116,11 +116,12 @@ public:
class GatherSourcesJob: public QV4::Debugging::Debugger::Job
{
QV4::ExecutionEngine *engine;
- const int seq;
+ QStringList sources;
public:
- GatherSourcesJob(QV4::ExecutionEngine *engine, int seq);
+ GatherSourcesJob(QV4::ExecutionEngine *engine);
void run();
+ const QStringList &result() const;
};
class ArgumentCollectJob: public QV4::Debugging::Debugger::Job
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp
index 7f22b16e45..270a6958a9 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp
@@ -105,27 +105,6 @@ void QV4DebuggerAgent::debuggerPaused(QV4::Debugging::Debugger *debugger,
m_debugService->send(event);
}
-void QV4DebuggerAgent::sourcesCollected(QV4::Debugging::Debugger *debugger,
- const QStringList &sources, int requestSequenceNr)
-{
- QJsonArray body;
- foreach (const QString &source, sources) {
- QJsonObject src;
- src[QLatin1String("name")] = source;
- src[QLatin1String("scriptType")] = 4;
- body.append(src);
- }
-
- QJsonObject response;
- response[QLatin1String("success")] = true;
- response[QLatin1String("running")] = debugger->state() == QV4::Debugging::Debugger::Running;
- response[QLatin1String("body")] = body;
- response[QLatin1String("command")] = QStringLiteral("scripts");
- response[QLatin1String("request_seq")] = requestSequenceNr;
- response[QLatin1String("type")] = QStringLiteral("response");
- m_debugService->send(response);
-}
-
void QV4DebuggerAgent::addDebugger(QV4::Debugging::Debugger *debugger)
{
Q_ASSERT(!m_debuggers.contains(debugger));
@@ -139,9 +118,6 @@ void QV4DebuggerAgent::addDebugger(QV4::Debugging::Debugger *debugger)
connect(debugger, SIGNAL(destroyed(QObject*)),
this, SLOT(handleDebuggerDeleted(QObject*)));
- connect(debugger, SIGNAL(sourcesCollected(QV4::Debugging::Debugger*,QStringList,int)),
- this, SLOT(sourcesCollected(QV4::Debugging::Debugger*,QStringList,int)),
- Qt::QueuedConnection);
connect(debugger, SIGNAL(debuggerPaused(QV4::Debugging::Debugger*,QV4::Debugging::PauseReason)),
this, SLOT(debuggerPaused(QV4::Debugging::Debugger*,QV4::Debugging::PauseReason)),
Qt::QueuedConnection);
@@ -152,8 +128,6 @@ void QV4DebuggerAgent::removeDebugger(QV4::Debugging::Debugger *debugger)
m_debuggers.removeAll(debugger);
disconnect(debugger, SIGNAL(destroyed(QObject*)),
this, SLOT(handleDebuggerDeleted(QObject*)));
- disconnect(debugger, SIGNAL(sourcesCollected(QV4::Debugging::Debugger*,QStringList,int)),
- this, SLOT(sourcesCollected(QV4::Debugging::Debugger*,QStringList,int)));
disconnect(debugger,
SIGNAL(debuggerPaused(QV4::Debugging::Debugger*,QV4::Debugging::PauseReason)),
this,
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h
index 6126eea772..64cf0e3d60 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h
@@ -66,8 +66,6 @@ public:
public slots:
void debuggerPaused(QV4::Debugging::Debugger *debugger, QV4::Debugging::PauseReason reason);
- void sourcesCollected(QV4::Debugging::Debugger *debugger, const QStringList &sources,
- int requestSequenceNr);
void handleDebuggerDeleted(QObject *debugger);
private:
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
index 0fb6df7fd2..bedabd0a63 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
@@ -62,7 +62,6 @@ QT_BEGIN_NAMESPACE
class V8CommandHandler;
class UnknownV8CommandHandler;
-int QV4DebugServiceImpl::debuggerIndex = 0;
int QV4DebugServiceImpl::sequence = 0;
class V8CommandHandler
@@ -103,7 +102,7 @@ protected:
void addCommand() { response.insert(QStringLiteral("command"), cmd); }
void addRequestSequence() { response.insert(QStringLiteral("request_seq"), seq); }
void addSuccess(bool success) { response.insert(QStringLiteral("success"), success); }
- void addBody(const QJsonObject &body)
+ void addBody(const QJsonValue &body)
{
response.insert(QStringLiteral("body"), body);
}
@@ -507,10 +506,22 @@ public:
// do it:
QV4::Debugging::Debugger *debugger = debugService->debuggerAgent.firstDebugger();
- GatherSourcesJob job(debugger->engine(), requestSequenceNr());
+ GatherSourcesJob job(debugger->engine());
debugger->runInEngine(&job);
- // response will be send by
+ QJsonArray body;
+ foreach (const QString &source, job.result()) {
+ QJsonObject src;
+ src[QLatin1String("name")] = source;
+ src[QLatin1String("scriptType")] = 4;
+ body.append(src);
+ }
+
+ addSuccess(true);
+ addRunning();
+ addBody(body);
+ addCommand();
+ addRequestSequence();
}
};
@@ -592,7 +603,7 @@ V8CommandHandler *QV4DebugServiceImpl::v8CommandHandler(const QString &command)
QV4DebugServiceImpl::QV4DebugServiceImpl(QObject *parent) :
QQmlConfigurableDebugService<QV4DebugService>(1, parent),
- debuggerAgent(this), version(1), theSelectedFrame(0),
+ debuggerAgent(this), theSelectedFrame(0),
unknownV8CommandHandler(new UnknownV8CommandHandler)
{
addHandler(new V8VersionRequest);
@@ -622,9 +633,7 @@ void QV4DebugServiceImpl::engineAboutToBeAdded(QQmlEngine *engine)
if (QQmlDebugConnector *server = QQmlDebugConnector::instance()) {
if (ee) {
ee->enableDebugger();
- QV4::Debugging::Debugger *debugger = ee->debugger;
- debuggerMap.insert(debuggerIndex++, debugger);
- debuggerAgent.addDebugger(debugger);
+ debuggerAgent.addDebugger(ee->debugger);
debuggerAgent.moveToThread(server->thread());
}
}
@@ -637,18 +646,8 @@ void QV4DebugServiceImpl::engineAboutToBeRemoved(QQmlEngine *engine)
QMutexLocker lock(&m_configMutex);
if (engine){
const QV4::ExecutionEngine *ee = QV8Engine::getV4(engine->handle());
- if (ee) {
- QV4::Debugging::Debugger *debugger = ee->debugger;
- typedef QMap<int, QV4::Debugging::Debugger *>::const_iterator DebuggerMapIterator;
- const DebuggerMapIterator end = debuggerMap.constEnd();
- for (DebuggerMapIterator i = debuggerMap.constBegin(); i != end; ++i) {
- if (i.value() == debugger) {
- debuggerMap.remove(i.key());
- break;
- }
- }
- debuggerAgent.removeDebugger(debugger);
- }
+ if (ee)
+ debuggerAgent.removeDebugger(ee->debugger);
}
QQmlConfigurableDebugService<QV4DebugService>::engineAboutToBeRemoved(engine);
}
@@ -719,7 +718,7 @@ void QV4DebugServiceImpl::sendSomethingToSomebody(const char *type, int magicNum
QByteArray response;
QQmlDebugStream rs(&response, QIODevice::WriteOnly);
rs << QByteArray(type)
- << QByteArray::number(version) << QByteArray::number(magicNumber);
+ << QByteArray::number(int(version())) << QByteArray::number(magicNumber);
emit messageToClient(name(), packMessage(type, response));
}
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
index 6c2950de8c..dbf41ac363 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h
@@ -107,10 +107,7 @@ private:
int encodeScopeType(QV4::Heap::ExecutionContext::ContextType scopeType);
QStringList breakOnSignals;
- QMap<int, QV4::Debugging::Debugger *> debuggerMap;
- static int debuggerIndex;
static int sequence;
- const int version;
QV4DataCollector::Refs collectedRefs;
QScopedPointer<QV4DataCollector> theCollector;
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp
index 4f131ac481..8f697f1571 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp
@@ -36,14 +36,12 @@
QT_BEGIN_NAMESPACE
-const QString QQmlEngineControlService::s_key = QStringLiteral("EngineControl");
-
-QQmlEngineControlService::QQmlEngineControlService(QObject *parent) :
- QQmlDebugService(s_key, 1, parent)
+QQmlEngineControlServiceImpl::QQmlEngineControlServiceImpl(QObject *parent) :
+ QQmlEngineControlService(1, parent)
{
}
-void QQmlEngineControlService::messageReceived(const QByteArray &message)
+void QQmlEngineControlServiceImpl::messageReceived(const QByteArray &message)
{
QMutexLocker lock(&dataMutex);
QQmlDebugStream d(message);
@@ -60,7 +58,7 @@ void QQmlEngineControlService::messageReceived(const QByteArray &message)
}
}
-void QQmlEngineControlService::engineAboutToBeAdded(QQmlEngine *engine)
+void QQmlEngineControlServiceImpl::engineAboutToBeAdded(QQmlEngine *engine)
{
QMutexLocker lock(&dataMutex);
if (state() == Enabled) {
@@ -73,7 +71,7 @@ void QQmlEngineControlService::engineAboutToBeAdded(QQmlEngine *engine)
}
}
-void QQmlEngineControlService::engineAboutToBeRemoved(QQmlEngine *engine)
+void QQmlEngineControlServiceImpl::engineAboutToBeRemoved(QQmlEngine *engine)
{
QMutexLocker lock(&dataMutex);
if (state() == Enabled) {
@@ -86,7 +84,7 @@ void QQmlEngineControlService::engineAboutToBeRemoved(QQmlEngine *engine)
}
}
-void QQmlEngineControlService::engineAdded(QQmlEngine *engine)
+void QQmlEngineControlServiceImpl::engineAdded(QQmlEngine *engine)
{
if (state() == Enabled) {
QMutexLocker lock(&dataMutex);
@@ -96,7 +94,7 @@ void QQmlEngineControlService::engineAdded(QQmlEngine *engine)
}
}
-void QQmlEngineControlService::engineRemoved(QQmlEngine *engine)
+void QQmlEngineControlServiceImpl::engineRemoved(QQmlEngine *engine)
{
if (state() == Enabled) {
QMutexLocker lock(&dataMutex);
@@ -106,7 +104,7 @@ void QQmlEngineControlService::engineRemoved(QQmlEngine *engine)
}
}
-void QQmlEngineControlService::sendMessage(QQmlEngineControlService::MessageType type, QQmlEngine *engine)
+void QQmlEngineControlServiceImpl::sendMessage(QQmlEngineControlServiceImpl::MessageType type, QQmlEngine *engine)
{
QByteArray message;
QQmlDebugStream d(&message, QIODevice::WriteOnly);
@@ -114,7 +112,7 @@ void QQmlEngineControlService::sendMessage(QQmlEngineControlService::MessageType
emit messageToClient(name(), message);
}
-void QQmlEngineControlService::stateChanged(State)
+void QQmlEngineControlServiceImpl::stateChanged(State)
{
// We flush everything for any kind of state change, to avoid complicated timing issues.
QMutexLocker lock(&dataMutex);
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h
index e2a93e562a..8dbc922a6f 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h
+++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h
@@ -35,7 +35,7 @@
#define QQMLENGINECONTROLSERVICE_H
#include <QMutex>
-#include <private/qqmldebugservice_p.h>
+#include <private/qqmldebugserviceinterfaces_p.h>
//
// W A R N I N G
@@ -50,11 +50,9 @@
QT_BEGIN_NAMESPACE
-class QQmlEngineControlService : public QQmlDebugService
+class QQmlEngineControlServiceImpl : public QQmlEngineControlService
{
public:
- static const QString s_key;
-
enum MessageType {
EngineAboutToBeAdded,
EngineAdded,
@@ -67,9 +65,11 @@ public:
StopWaitingEngine
};
- QQmlEngineControlService(QObject *parent = 0);
+ QQmlEngineControlServiceImpl(QObject *parent = 0);
protected:
+ friend class QQmlProfilerServiceFactory;
+
QMutex dataMutex;
QList<QQmlEngine *> startingEngines;
QList<QQmlEngine *> stoppingEngines;
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservicefactory.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservicefactory.cpp
index 83c2075246..c1b8e6a817 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservicefactory.cpp
+++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservicefactory.cpp
@@ -42,8 +42,8 @@ QQmlDebugService *QQmlProfilerServiceFactory::create(const QString &key)
if (key == QQmlProfilerServiceImpl::s_key)
return new QQmlProfilerServiceImpl(this);
- if (key == QQmlEngineControlService::s_key)
- return new QQmlEngineControlService(this);
+ if (key == QQmlEngineControlServiceImpl::s_key)
+ return new QQmlEngineControlServiceImpl(this);
return 0;
}
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp
index 24e01f4c68..3498555f65 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp
+++ b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.cpp
@@ -37,12 +37,16 @@
QT_BEGIN_NAMESPACE
QV4ProfilerAdapter::QV4ProfilerAdapter(QQmlProfilerService *service, QV4::ExecutionEngine *engine) :
- QQmlAbstractProfilerAdapter(service), dataPos(0), memoryPos(0)
+ QQmlAbstractProfilerAdapter(service), m_functionCallPos(0), m_memoryPos(0)
{
engine->enableProfiler();
connect(this, SIGNAL(profilingEnabled(quint64)),
- engine->profiler, SLOT(startProfiling(quint64)));
+ this, SLOT(forwardEnabled(quint64)));
connect(this, SIGNAL(profilingEnabledWhileWaiting(quint64)),
+ this, SLOT(forwardEnabledWhileWaiting(quint64)), Qt::DirectConnection);
+ connect(this, SIGNAL(v4ProfilingEnabled(quint64)),
+ engine->profiler, SLOT(startProfiling(quint64)));
+ connect(this, SIGNAL(v4ProfilingEnabledWhileWaiting(quint64)),
engine->profiler, SLOT(startProfiling(quint64)), Qt::DirectConnection);
connect(this, SIGNAL(profilingDisabled()), engine->profiler, SLOT(stopProfiling()));
connect(this, SIGNAL(profilingDisabledWhileWaiting()), engine->profiler, SLOT(stopProfiling()),
@@ -59,29 +63,29 @@ QV4ProfilerAdapter::QV4ProfilerAdapter(QQmlProfilerService *service, QV4::Execut
qint64 QV4ProfilerAdapter::appendMemoryEvents(qint64 until, QList<QByteArray> &messages)
{
QByteArray message;
- while (memory_data.length() > memoryPos && memory_data[memoryPos].timestamp <= until) {
+ while (m_memoryData.length() > m_memoryPos && m_memoryData[m_memoryPos].timestamp <= until) {
QQmlDebugStream d(&message, QIODevice::WriteOnly);
- QV4::Profiling::MemoryAllocationProperties &props = memory_data[memoryPos];
+ QV4::Profiling::MemoryAllocationProperties &props = m_memoryData[m_memoryPos];
d << props.timestamp << MemoryAllocation << props.type << props.size;
- ++memoryPos;
+ ++m_memoryPos;
messages.append(message);
}
- return memory_data.length() == memoryPos ? -1 : memory_data[memoryPos].timestamp;
+ return m_memoryData.length() == m_memoryPos ? -1 : m_memoryData[m_memoryPos].timestamp;
}
qint64 QV4ProfilerAdapter::finalizeMessages(qint64 until, QList<QByteArray> &messages,
qint64 callNext)
{
if (callNext == -1) {
- data.clear();
- dataPos = 0;
+ m_functionCallData.clear();
+ m_functionCallPos = 0;
}
qint64 memoryNext = appendMemoryEvents(until, messages);
if (memoryNext == -1) {
- memory_data.clear();
- memoryPos = 0;
+ m_memoryData.clear();
+ m_memoryPos = 0;
return callNext;
}
@@ -92,18 +96,21 @@ qint64 QV4ProfilerAdapter::sendMessages(qint64 until, QList<QByteArray> &message
{
QByteArray message;
while (true) {
- while (!stack.isEmpty() && (dataPos == data.length() ||
- stack.top() <= data[dataPos].start)) {
- if (stack.top() > until)
- return finalizeMessages(until, messages, stack.top());
+ while (!m_stack.isEmpty() &&
+ (m_functionCallPos == m_functionCallData.length() ||
+ m_stack.top() <= m_functionCallData[m_functionCallPos].start)) {
+ if (m_stack.top() > until)
+ return finalizeMessages(until, messages, m_stack.top());
- appendMemoryEvents(stack.top(), messages);
+ appendMemoryEvents(m_stack.top(), messages);
QQmlDebugStream d(&message, QIODevice::WriteOnly);
- d << stack.pop() << RangeEnd << Javascript;
+ d << m_stack.pop() << RangeEnd << Javascript;
messages.append(message);
}
- while (dataPos != data.length() && (stack.empty() || data[dataPos].start < stack.top())) {
- const QV4::Profiling::FunctionCallProperties &props = data[dataPos];
+ while (m_functionCallPos != m_functionCallData.length() &&
+ (m_stack.empty() || m_functionCallData[m_functionCallPos].start < m_stack.top())) {
+ const QV4::Profiling::FunctionCallProperties &props =
+ m_functionCallData[m_functionCallPos];
if (props.start > until)
return finalizeMessages(until, messages, props.start);
@@ -122,32 +129,53 @@ qint64 QV4ProfilerAdapter::sendMessages(qint64 until, QList<QByteArray> &message
d_data << props.start << RangeData << Javascript << props.name;
messages.push_back(message);
message.clear();
- stack.push(props.end);
- ++dataPos;
+ m_stack.push(props.end);
+ ++m_functionCallPos;
}
- if (stack.empty() && dataPos == data.length())
+ if (m_stack.empty() && m_functionCallPos == m_functionCallData.length())
return finalizeMessages(until, messages, -1);
}
}
void QV4ProfilerAdapter::receiveData(
- const QVector<QV4::Profiling::FunctionCallProperties> &new_data,
- const QVector<QV4::Profiling::MemoryAllocationProperties> &new_memory_data)
+ const QVector<QV4::Profiling::FunctionCallProperties> &functionCallData,
+ const QVector<QV4::Profiling::MemoryAllocationProperties> &memoryData)
{
// In rare cases it could be that another flush or stop event is processed while data from
// the previous one is still pending. In that case we just append the data.
- if (data.isEmpty())
- data = new_data;
+ if (m_functionCallData.isEmpty())
+ m_functionCallData = functionCallData;
else
- data.append(new_data);
+ m_functionCallData.append(functionCallData);
- if (memory_data.isEmpty())
- memory_data = new_memory_data;
+ if (m_memoryData.isEmpty())
+ m_memoryData = memoryData;
else
- memory_data.append(new_memory_data);
+ m_memoryData.append(memoryData);
service->dataReady(this);
}
+quint64 QV4ProfilerAdapter::translateFeatures(quint64 qmlFeatures)
+{
+ quint64 v4Features = 0;
+ const quint64 one = 1;
+ if (qmlFeatures & (one << ProfileJavaScript))
+ v4Features |= (one << QV4::Profiling::FeatureFunctionCall);
+ if (qmlFeatures & (one << ProfileMemory))
+ v4Features |= (one << QV4::Profiling::FeatureMemoryAllocation);
+ return v4Features;
+}
+
+void QV4ProfilerAdapter::forwardEnabled(quint64 features)
+{
+ emit v4ProfilingEnabled(translateFeatures(features));
+}
+
+void QV4ProfilerAdapter::forwardEnabledWhileWaiting(quint64 features)
+{
+ emit v4ProfilingEnabledWhileWaiting(translateFeatures(features));
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h
index cea3da72e3..c07fc4dc96 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h
+++ b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h
@@ -62,18 +62,28 @@ public:
virtual qint64 sendMessages(qint64 until, QList<QByteArray> &messages);
+signals:
+ void v4ProfilingEnabled(quint64 v4Features);
+ void v4ProfilingEnabledWhileWaiting(quint64 v4Features);
+
public slots:
void receiveData(const QVector<QV4::Profiling::FunctionCallProperties> &,
const QVector<QV4::Profiling::MemoryAllocationProperties> &);
+private slots:
+ void forwardEnabled(quint64 features);
+ void forwardEnabledWhileWaiting(quint64 features);
+
private:
- QVector<QV4::Profiling::FunctionCallProperties> data;
- QVector<QV4::Profiling::MemoryAllocationProperties> memory_data;
- int dataPos;
- int memoryPos;
- QStack<qint64> stack;
+ QVector<QV4::Profiling::FunctionCallProperties> m_functionCallData;
+ QVector<QV4::Profiling::MemoryAllocationProperties> m_memoryData;
+ int m_functionCallPos;
+ int m_memoryPos;
+ QStack<qint64> m_stack;
qint64 appendMemoryEvents(qint64 until, QList<QByteArray> &messages);
qint64 finalizeMessages(qint64 until, QList<QByteArray> &messages, qint64 callNext);
+
+ static quint64 translateFeatures(quint64 qmlFeatures);
};
QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
index 69d36beaca..d3a8d1f0d1 100644
--- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
+++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
@@ -40,6 +40,7 @@
#include <private/qqmlengine_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmldebugpluginmanager_p.h>
+#include <private/qqmldebugserviceinterfaces_p.h>
#include <QtCore/QAtomicInt>
#include <QtCore/QDir>
@@ -105,6 +106,11 @@ public:
m_fileName = fileName;
}
+ const QString &pluginName() const
+ {
+ return m_pluginName;
+ }
+
void run();
private:
@@ -304,6 +310,9 @@ bool QQmlDebugServerImpl::open(const QVariantHash &configuration = QVariantHash(
}
}
+ if (m_thread.pluginName().isEmpty())
+ return false;
+
QMutexLocker locker(&m_helloMutex);
m_thread.start();
m_helloCondition.wait(&m_helloMutex); // wait for connection
@@ -312,6 +321,7 @@ bool QQmlDebugServerImpl::open(const QVariantHash &configuration = QVariantHash(
return true;
}
+#define qUsage qWarning().noquote().nospace
void QQmlDebugServerImpl::parseArguments()
{
// format: qmljsdebugger=port:<port_from>[,port_to],host:<ip address>][,block]
@@ -360,9 +370,8 @@ void QQmlDebugServerImpl::parseArguments()
} else if (!services.isEmpty()) {
services.append(strArgument);
} else {
- qWarning() << QString::fromLatin1("QML Debugger: Invalid argument '%1' "
- "detected. Ignoring the same.")
- .arg(strArgument);
+ qUsage() << tr("QML Debugger: Invalid argument \"%1\" detected. Ignoring the same.")
+ .arg(strArgument);
}
}
@@ -374,11 +383,43 @@ void QQmlDebugServerImpl::parseArguments()
else
m_thread.setPortRange(portFrom, portTo, hostAddress);
} else {
- qWarning() << QString::fromLatin1("QML Debugger: Ignoring \"-qmljsdebugger=%1\". "
- "Format is qmljsdebugger=port:<port_from>[,port_to],host:"
- "<ip address>][,block]").arg(args);
+ qUsage() << tr("QML Debugger: Ignoring \"-qmljsdebugger=%1\".").arg(args);
+ qUsage() << tr("The format is \"-qmljsdebugger=[file:<file>|port:<port_from>][,<port_to>]"
+ "[,host:<ip address>][,block][,services:<service>][,<service>]*\"\n");
+ qUsage() << tr("\"file:\" can be used to specify the name of a file the debugger will try "
+ "to connect to using a QLocalSocket. If \"file:\" is given any \"host:\" and"
+ "\"port:\" arguments will be ignored.\n");
+ qUsage() << tr("\"host:\" and \"port:\" can be used to specify an address and a single "
+ "port or a range of ports the debugger will try to bind to with a "
+ "QTcpServer.\n");
+ qUsage() << tr("\"block\" makes the debugger and some services wait for clients to be "
+ "connected and ready before the first QML engine starts.\n");
+ qUsage() << tr("\"services:\" can be used to specify which debug services the debugger "
+ "should load. Some debug services interact badly with others. The V4 "
+ "debugger should not be loaded when using the QML profiler as it will force "
+ "any V4 engines to use the JavaScript interpreter rather than the JIT. The "
+ "following debug services are available by default:");
+ qUsage() << QQmlEngineDebugService::s_key << tr("\t- The QML debugger");
+ qUsage() << QV4DebugService::s_key << tr("\t- The V4 debugger");
+ qUsage() << QQmlInspectorService::s_key << tr("\t- The QML inspector");
+ qUsage() << QQmlProfilerService::s_key << tr("\t- The QML profiler");
+ qUsage() << QQmlEngineControlService::s_key
+ << tr("\t- Allows the client to delay the starting and stopping of\n"
+ "\t\t QML engines until other services are ready. QtCreator\n"
+ "\t\t uses this service with the QML profiler in order to\n"
+ "\t\t profile multiple QML engines at the same time.");
+ qUsage() << QDebugMessageService::s_key
+ << tr("\t- Sends qDebug() and similar messages over the QML debug\n"
+ "\t\t connection. QtCreator uses this for showing debug\n"
+ "\t\t messages in the JavaScript console.");
+ qUsage() << tr("Other services offered by qmltooling plugins that implement "
+ "QQmlDebugServiceFactory and which can be found in the standard plugin "
+ "paths will also be available and can be specified. If no \"services\" "
+ "argument is given, all services found this way, including the default "
+ "ones, are loaded.");
}
}
+#undef qUsage
void QQmlDebugServerImpl::receiveMessage()
{
@@ -599,8 +640,6 @@ bool QQmlDebugServerImpl::removeService(const QString &name)
disconnect(service, SIGNAL(messageToClient(QString,QByteArray)),
this, SLOT(sendMessage(QString,QByteArray)));
- m_plugins.remove(service->name());
-
return true;
}
diff --git a/src/qml/debugger/qqmldebug.cpp b/src/qml/debugger/qqmldebug.cpp
index 35dc110e9a..b308f5aa29 100644
--- a/src/qml/debugger/qqmldebug.cpp
+++ b/src/qml/debugger/qqmldebug.cpp
@@ -33,6 +33,7 @@
#include "qqmldebug.h"
#include "qqmldebugconnector_p.h"
+#include "qqmldebugserviceinterfaces_p.h"
#include <private/qqmlengine_p.h>
@@ -52,10 +53,64 @@ QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
}
/*!
+ * Retrieves the plugin keys of the debugger services provided by default. The debugger services
+ * enable a debug client to use a Qml/JavaScript debugger, in order to set breakpoints, pause
+ * execution, evaluate expressions and similar debugging tasks.
+ * \return List of plugin keys of default debugger services.
+ */
+QStringList QQmlDebuggingEnabler::debuggerServices()
+{
+ return QStringList() << QV4DebugService::s_key << QQmlEngineDebugService::s_key
+ << QDebugMessageService::s_key;
+}
+
+/*!
+ * Retrieves the plugin keys of the inspector services provided by default. The inspector services
+ * enable a debug client to use a visual inspector tool for Qt Quick.
+ * \return List of plugin keys of default inspector services.
+ */
+QStringList QQmlDebuggingEnabler::inspectorServices()
+{
+ return QStringList() << QQmlInspectorService::s_key;
+}
+
+/*!
+ * Retrieves the names of the profiler services provided by default. The profiler services enable a
+ * debug client to use a profiler and track the time taken by various QML and JavaScript constructs,
+ * as well as the QtQuick SceneGraph.
+ * \return List of plugin keys of default profiler services.
+ */
+QStringList QQmlDebuggingEnabler::profilerServices()
+{
+ return QStringList() << QQmlProfilerService::s_key << QQmlEngineControlService::s_key;
+}
+
+/*!
+ * Restricts the services available from the debug connector. The connector will scan plugins in the
+ * "qmltooling" subdirectory of the default plugin path. If this function is not called before the
+ * debug connector is enabled, all services found that way will be available to any client. If this
+ * function is called, only the services with plugin keys given in \a services will be available.
+ *
+ * Use this method to disable debugger and inspector services when profiling to get better
+ * performance and more realistic profiles. The debugger service will put any JavaScript engine it
+ * connects to into interpreted mode, disabling the JIT compiler.
+ *
+ * \sa debuggerServices(), profilerServices(), inspectorServices()
+ */
+void QQmlDebuggingEnabler::setServices(const QStringList &services)
+{
+#ifndef QQML_NO_DEBUG_PROTOCOL
+ QQmlDebugConnector::setServices(services);
+#else
+ Q_UNUSED(services);
+#endif
+}
+
+/*!
* \enum QQmlDebuggingEnabler::StartMode
*
- * Defines the debug server's start behavior. You can interrupt QML engines starting while a debug
- * client is connecting, in order to set breakpoints in or profile startup code.
+ * Defines the debug connector's start behavior. You can interrupt QML engines starting while a
+ * debug client is connecting, in order to set breakpoints in or profile startup code.
*
* \value DoNotWaitForClient Run any QML engines as usual while the debug services are connecting.
* \value WaitForClient If a QML engine starts while the debug services are connecting,
@@ -63,13 +118,13 @@ QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
*/
/*!
- * Enables debugging for QML engines created after calling this function. The debug server will
+ * Enables debugging for QML engines created after calling this function. The debug connector will
* listen on \a port at \a hostName and block the QML engine until it receives a connection if
* \a mode is \c WaitForClient. If \a mode is not specified it won't block and if \a hostName is not
- * specified it will listen on all available interfaces. You can only start one debug server at a
- * time. A debug server may have already been started if the -qmljsdebugger= command line argument
- * was given. This method returns \c true if a new debug server was successfully started, or
- * \c false otherwise.
+ * specified it will listen on all available interfaces. You can only start one debug connector at a
+ * time. A debug connector may have already been started if the -qmljsdebugger= command line
+ * argument was given. This method returns \c true if a new debug connector was successfully
+ * started, or \c false otherwise.
*/
bool QQmlDebuggingEnabler::startTcpDebugServer(int port, StartMode mode, const QString &hostName)
{
@@ -85,7 +140,7 @@ bool QQmlDebuggingEnabler::startTcpDebugServer(int port, StartMode mode, const Q
}
#else
Q_UNUSED(port);
- Q_UNUSED(block);
+ Q_UNUSED(mode);
Q_UNUSED(hostName);
#endif
return false;
@@ -94,12 +149,12 @@ bool QQmlDebuggingEnabler::startTcpDebugServer(int port, StartMode mode, const Q
/*!
* \since 5.6
*
- * Enables debugging for QML engines created after calling this function. The debug server will
+ * Enables debugging for QML engines created after calling this function. The debug connector will
* connect to a debugger waiting on a local socket at the given \a socketFileName and block the QML
* engine until the connection is established if \a mode is \c WaitForClient. If \a mode is not
- * specified it will not block. You can only start one debug server at a time. A debug server may
- * have already been started if the -qmljsdebugger= command line argument was given. This method
- * returns \c true if a new debug server was successfully started, or \c false otherwise.
+ * specified it will not block. You can only start one debug connector at a time. A debug connector
+ * may have already been started if the -qmljsdebugger= command line argument was given. This method
+ * returns \c true if a new debug connector was successfully started, or \c false otherwise.
*/
bool QQmlDebuggingEnabler::connectToLocalDebugger(const QString &socketFileName, StartMode mode)
{
@@ -114,7 +169,7 @@ bool QQmlDebuggingEnabler::connectToLocalDebugger(const QString &socketFileName,
}
#else
Q_UNUSED(fileName);
- Q_UNUSED(block);
+ Q_UNUSED(mode);
#endif
return false;
}
diff --git a/src/qml/debugger/qqmldebug.h b/src/qml/debugger/qqmldebug.h
index 5d65982a49..6316ebd195 100644
--- a/src/qml/debugger/qqmldebug.h
+++ b/src/qml/debugger/qqmldebug.h
@@ -48,6 +48,13 @@ struct Q_QML_EXPORT QQmlDebuggingEnabler
};
QQmlDebuggingEnabler(bool printWarning = true);
+
+ static QStringList debuggerServices();
+ static QStringList inspectorServices();
+ static QStringList profilerServices();
+
+ static void setServices(const QStringList &services);
+
static bool startTcpDebugServer(int port, StartMode mode = DoNotWaitForClient,
const QString &hostName = QString());
static bool connectToLocalDebugger(const QString &socketFileName,
diff --git a/src/qml/debugger/qqmldebugserviceinterfaces.cpp b/src/qml/debugger/qqmldebugserviceinterfaces.cpp
index 2bf9f2785c..992b007e86 100644
--- a/src/qml/debugger/qqmldebugserviceinterfaces.cpp
+++ b/src/qml/debugger/qqmldebugserviceinterfaces.cpp
@@ -39,5 +39,7 @@ const QString QV4DebugService::s_key = QStringLiteral("V8Debugger");
const QString QQmlEngineDebugService::s_key = QStringLiteral("QmlDebugger");
const QString QQmlInspectorService::s_key = QStringLiteral("QmlInspector");
const QString QQmlProfilerService::s_key = QStringLiteral("CanvasFrameRate");
+const QString QDebugMessageService::s_key = QStringLiteral("DebugMessages");
+const QString QQmlEngineControlService::s_key = QStringLiteral("EngineControl");
QT_END_NAMESPACE
diff --git a/src/qml/debugger/qqmldebugserviceinterfaces_p.h b/src/qml/debugger/qqmldebugserviceinterfaces_p.h
index a2ba670608..54f9114159 100644
--- a/src/qml/debugger/qqmldebugserviceinterfaces_p.h
+++ b/src/qml/debugger/qqmldebugserviceinterfaces_p.h
@@ -60,6 +60,8 @@ class Q_QML_PRIVATE_EXPORT QV4DebugService : protected QQmlDebugService
{
Q_OBJECT
public:
+ static const QString s_key;
+
virtual void signalEmitted(const QString &signal) = 0;
protected:
@@ -67,14 +69,14 @@ protected:
QV4DebugService(float version, QObject *parent = 0) :
QQmlDebugService(s_key, version, parent) {}
-
- static const QString s_key;
};
class Q_QML_PRIVATE_EXPORT QQmlProfilerService : protected QQmlDebugService
{
Q_OBJECT
public:
+ static const QString s_key;
+
virtual void addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0;
virtual void removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0;
@@ -89,14 +91,14 @@ protected:
QQmlProfilerService(float version, QObject *parent = 0) :
QQmlDebugService(s_key, version, parent) {}
-
- static const QString s_key;
};
class Q_QML_PRIVATE_EXPORT QQmlEngineDebugService : protected QQmlDebugService
{
Q_OBJECT
public:
+ static const QString s_key;
+
virtual void objectCreated(QQmlEngine *engine, QObject *object) = 0;
virtual void setStatesDelegate(QQmlDebugStatesDelegate *) = 0;
@@ -107,14 +109,14 @@ protected:
QQmlDebugService(s_key, version, parent) {}
QQmlBoundSignal *nextSignal(QQmlBoundSignal *prev) { return prev->m_nextSignal; }
-
- static const QString s_key;
};
class Q_QML_PRIVATE_EXPORT QQmlInspectorService : protected QQmlDebugService
{
Q_OBJECT
public:
+ static const QString s_key;
+
virtual void addView(QObject *) = 0;
virtual void removeView(QObject *) = 0;
@@ -123,8 +125,33 @@ protected:
QQmlInspectorService(float version, QObject *parent = 0) :
QQmlDebugService(s_key, version, parent) {}
+};
+class Q_QML_PRIVATE_EXPORT QDebugMessageService : protected QQmlDebugService
+{
+ Q_OBJECT
+public:
static const QString s_key;
+
+protected:
+ friend class QQmlDebugConnector;
+
+ QDebugMessageService(float version, QObject *parent = 0) :
+ QQmlDebugService(s_key, version, parent) {}
+};
+
+class Q_QML_PRIVATE_EXPORT QQmlEngineControlService : protected QQmlDebugService
+{
+ Q_OBJECT
+public:
+ static const QString s_key;
+
+protected:
+ friend class QQmlDebugConnector;
+
+ QQmlEngineControlService(float version, QObject *parent = 0) :
+ QQmlDebugService(s_key, version, parent) {}
+
};
QT_END_NAMESPACE
diff --git a/src/qml/debugger/qqmlprofilerdefinitions_p.h b/src/qml/debugger/qqmlprofilerdefinitions_p.h
index 1213b67b3c..952eafed29 100644
--- a/src/qml/debugger/qqmlprofilerdefinitions_p.h
+++ b/src/qml/debugger/qqmlprofilerdefinitions_p.h
@@ -126,8 +126,8 @@ struct QQmlProfilerDefinitions {
typedef QV4::Profiling::MemoryType MemoryType;
enum ProfileFeature {
- ProfileJavaScript = QV4::Profiling::FeatureFunctionCall,
- ProfileMemory = QV4::Profiling::FeatureMemoryAllocation,
+ ProfileJavaScript,
+ ProfileMemory,
ProfilePixmapCache,
ProfileSceneGraph,
ProfileAnimations,
diff --git a/src/qml/jsruntime/qv4debugging_p.h b/src/qml/jsruntime/qv4debugging_p.h
index 9b07a31f26..14bff238cc 100644
--- a/src/qml/jsruntime/qv4debugging_p.h
+++ b/src/qml/jsruntime/qv4debugging_p.h
@@ -173,7 +173,6 @@ public: // execution hooks
void aboutToThrow();
signals:
- void sourcesCollected(QV4::Debugging::Debugger *self, const QStringList &sources, int seq);
void debuggerPaused(QV4::Debugging::Debugger *self, QV4::Debugging::PauseReason reason);
private:
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 8f471132b7..ee294b3678 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -1447,7 +1447,8 @@ static QV4::ReturnedValue CallOverloaded(const QQmlObjectOrGadget &object, const
const QQmlPropertyData *candidate = &data;
while (candidate) {
error += QLatin1String("\n ") +
- QString::fromUtf8(object.metaObject()->method(candidate->coreIndex).methodSignature().constData());
+ QString::fromUtf8(object.metaObject()->method(candidate->coreIndex)
+ .methodSignature());
candidate = RelatedMethod(object, candidate, dummy, propertyCache);
}
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index 477a517e32..decffaf2fa 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -250,7 +250,7 @@ QQmlBoundSignal::QQmlBoundSignal(QObject *target, int signal, QObject *owner,
QQmlEngine *engine)
: QQmlNotifierEndpoint(QQmlNotifierEndpoint::QQmlBoundSignal),
m_prevSignal(0), m_nextSignal(0),
- m_expression(0)
+ m_enabled(true), m_expression(0)
{
addToObject(owner);
@@ -313,18 +313,33 @@ void QQmlBoundSignal::takeExpression(QQmlBoundSignalExpression *e)
m_expression->setNotifyOnValueChanged(false);
}
+/*!
+ This property holds whether the item will emit signals.
+
+ The QQmlBoundSignal callback will only emit a signal if this property is set to true.
+
+ By default, this property is true.
+ */
+void QQmlBoundSignal::setEnabled(bool enabled)
+{
+ if (m_enabled == enabled)
+ return;
+
+ m_enabled = enabled;
+}
+
void QQmlBoundSignal_callback(QQmlNotifierEndpoint *e, void **a)
{
QQmlBoundSignal *s = static_cast<QQmlBoundSignal*>(e);
- if (!s->m_expression)
+ if (!s->m_expression || !s->m_enabled)
return;
QV4DebugService *service = QQmlDebugConnector::service<QV4DebugService>();
if (service)
- service->signalEmitted(QString::fromLatin1(QMetaObjectPrivate::signal(
- s->m_expression->target()->metaObject(),
- s->signalIndex()).methodSignature()));
+ service->signalEmitted(QString::fromUtf8(QMetaObjectPrivate::signal(
+ s->m_expression->target()->metaObject(),
+ s->signalIndex()).methodSignature()));
QQmlEngine *engine;
if (s->m_expression && (engine = s->m_expression->engine())) {
diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h
index 3742317484..ef8fdd4a1a 100644
--- a/src/qml/qml/qqmlboundsignal_p.h
+++ b/src/qml/qml/qqmlboundsignal_p.h
@@ -108,6 +108,8 @@ public:
QQmlBoundSignalExpression *expression() const;
void takeExpression(QQmlBoundSignalExpression *);
+ void setEnabled(bool enabled);
+
private:
friend void QQmlBoundSignal_callback(QQmlNotifierEndpoint *, void **);
friend class QQmlPropertyPrivate;
@@ -119,6 +121,8 @@ private:
QQmlBoundSignal **m_prevSignal;
QQmlBoundSignal *m_nextSignal;
+ bool m_enabled;
+
QQmlBoundSignalExpressionPointer m_expression;
};
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index be535025e6..56252ec1ab 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -176,6 +176,7 @@ void QQmlEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int
qmlRegisterType<QQmlComponent>(uri,versionMajor,versionMinor,"Component");
qmlRegisterType<QObject>(uri,versionMajor,versionMinor,"QtObject");
qmlRegisterType<QQmlBind>(uri, versionMajor, versionMinor,"Binding");
+ qmlRegisterType<QQmlConnections,1>(uri, versionMajor, (versionMinor < 3 ? 3 : versionMinor), "Connections"); //Only available in >=2.3
qmlRegisterType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections");
qmlRegisterType<QQmlTimer>(uri, versionMajor, versionMinor,"Timer");
qmlRegisterType<QQmlInstantiator>(uri, versionMajor, (versionMinor < 1 ? 1 : versionMinor), "Instantiator"); //Only available in >=2.1
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 8f73732615..d0d14d9416 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1000,13 +1000,21 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath,
}
#else
- Q_UNUSED(qmldirFilePath);
- Q_UNUSED(uri);
Q_UNUSED(vmaj);
Q_UNUSED(vmin);
Q_UNUSED(database);
Q_UNUSED(qmldir);
- Q_UNUSED(errors);
+
+ if (errors) {
+ QQmlError error;
+ error.setDescription(
+ QQmlImportDatabase::tr(
+ "plugin cannot be loaded for module \"%1\": library loading is disabled")
+ .arg(uri));
+ error.setUrl(QUrl::fromLocalFile(qmldirFilePath));
+ errors->prepend(error);
+ }
+
return false;
#endif // QT_NO_LIBRARY
return true;
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index c03a463c83..f096dfeea9 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -884,9 +884,10 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
QMetaMethod signalMethod = _qobject->metaObject()->method(property->coreIndex);
if (!QMetaObject::checkConnectArgs(signalMethod, method)) {
- recordError(binding->valueLocation, tr("Cannot connect mismatched signal/slot %1 %vs. %2")
- .arg(QString::fromLatin1(method.methodSignature().constData()))
- .arg(QString::fromLatin1(signalMethod.methodSignature().constData())));
+ recordError(binding->valueLocation,
+ tr("Cannot connect mismatched signal/slot %1 %vs. %2")
+ .arg(QString::fromUtf8(method.methodSignature()))
+ .arg(QString::fromUtf8(signalMethod.methodSignature())));
return false;
}
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 67c4295d95..b1f2549035 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -793,8 +793,10 @@ int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void *
// are not rewritten correctly but this bug is deemed out-of-scope to fix for
// performance reasons; see QTBUG-24064) and thus compilation will have failed.
QQmlError e;
- e.setDescription(QString(QLatin1String("Exception occurred during compilation of function: %1")).
- arg(QLatin1String(QMetaObject::method(_id).methodSignature().constData())));
+ e.setDescription(QString::fromLatin1("Exception occurred during compilation of "
+ "function: %1")
+ .arg(QString::fromUtf8(QMetaObject::method(_id)
+ .methodSignature())));
ep->warning(e);
return -1; // The dynamic method with that id is not available.
}
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 3fc7ac7748..89088e5b3e 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -899,7 +899,7 @@ ReturnedValue QtObject::method_btoa(CallContext *ctx)
/*!
\qmlmethod string Qt::atob(data)
-ASCII to binary - this function returns a base64 decoding of \c data.
+ASCII to binary - this function decodes the base64 encoded \a data string and returns it.
*/
ReturnedValue QtObject::method_atob(CallContext *ctx)
{
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index 6a93410ecb..5f69bf5f94 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -51,11 +51,12 @@ QT_BEGIN_NAMESPACE
class QQmlConnectionsPrivate : public QObjectPrivate
{
public:
- QQmlConnectionsPrivate() : target(0), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
+ QQmlConnectionsPrivate() : target(0), enabled(true), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
QList<QQmlBoundSignal*> boundsignals;
QObject *target;
+ bool enabled;
bool targetSet;
bool ignoreUnknownSignals;
bool componentcomplete;
@@ -177,6 +178,34 @@ void QQmlConnections::setTarget(QObject *obj)
}
/*!
+ \qmlproperty bool QtQml::Connections::enabled
+ \since 5.7
+
+ This property holds whether the item accepts change events.
+
+ By default, this property is \c true.
+*/
+bool QQmlConnections::isEnabled() const
+{
+ Q_D(const QQmlConnections);
+ return d->enabled;
+}
+
+void QQmlConnections::setEnabled(bool enabled)
+{
+ Q_D(QQmlConnections);
+ if (d->enabled == enabled)
+ return;
+
+ d->enabled = enabled;
+
+ foreach (QQmlBoundSignal *s, d->boundsignals)
+ s->setEnabled(d->enabled);
+
+ emit enabledChanged();
+}
+
+/*!
\qmlproperty bool QtQml::Connections::ignoreUnknownSignals
Normally, a connection to a non-existent signal produces runtime errors.
diff --git a/src/qml/types/qqmlconnections_p.h b/src/qml/types/qqmlconnections_p.h
index 234c5061a7..d330b772cc 100644
--- a/src/qml/types/qqmlconnections_p.h
+++ b/src/qml/types/qqmlconnections_p.h
@@ -63,6 +63,7 @@ class Q_AUTOTEST_EXPORT QQmlConnections : public QObject, public QQmlParserStatu
Q_INTERFACES(QQmlParserStatus)
Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_REVISION(1) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals)
public:
@@ -72,11 +73,15 @@ public:
QObject *target() const;
void setTarget(QObject *);
+ bool isEnabled() const;
+ void setEnabled(bool enabled);
+
bool ignoreUnknownSignals() const;
void setIgnoreUnknownSignals(bool ignore);
Q_SIGNALS:
void targetChanged();
+ Q_REVISION(1) void enabledChanged();
private:
void connectSignals();
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index e030144676..b378398730 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2321,7 +2321,7 @@ QQuickItem::~QQuickItem()
// XXX todo - optimize
while (!d->childItems.isEmpty())
- d->childItems.first()->setParentItem(0);
+ d->childItems.constFirst()->setParentItem(0);
for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
QQuickAnchorsPrivate *anchor = d->changeListeners.at(ii).listener->anchorPrivate();
@@ -2483,7 +2483,7 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo
from = item->parentItem();
} else {
if (!item->childItems().isEmpty())
- from = item->childItems().first();
+ from = item->d_func()->childItems.constFirst();
else
from = item->parentItem();
}
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 2958c0a67a..6a2de58318 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1319,10 +1319,10 @@ void QQuickListViewPrivate::updateFooter()
}
FxListItemSG *listItem = static_cast<FxListItemSG*>(footer);
- if (visibleItems.count()) {
- if (footerPositioning == QQuickListView::OverlayFooter) {
- listItem->setPosition(isContentFlowReversed() ? -position() - footerSize() : position() + size() - footerSize());
- } else if (footerPositioning == QQuickListView::PullBackFooter) {
+ if (footerPositioning == QQuickListView::OverlayFooter) {
+ listItem->setPosition(isContentFlowReversed() ? -position() - footerSize() : position() + size() - footerSize());
+ } else if (visibleItems.count()) {
+ if (footerPositioning == QQuickListView::PullBackFooter) {
qreal viewPos = isContentFlowReversed() ? -position() : position() + size();
qreal clampedPos = qBound(originPosition() - footerSize() + size(), listItem->position(), lastPosition());
listItem->setPosition(qBound(viewPos - footerSize(), clampedPos, viewPos));
@@ -1358,26 +1358,24 @@ void QQuickListViewPrivate::updateHeader()
}
FxListItemSG *listItem = static_cast<FxListItemSG*>(header);
- if (listItem) {
- if (visibleItems.count()) {
- if (headerPositioning == QQuickListView::OverlayHeader) {
- listItem->setPosition(isContentFlowReversed() ? -position() - size() : position());
- } else if (headerPositioning == QQuickListView::PullBackHeader) {
- qreal viewPos = isContentFlowReversed() ? -position() - size() : position();
- qreal clampedPos = qBound(originPosition() - headerSize(), listItem->position(), lastPosition() - headerSize() - size());
- listItem->setPosition(qBound(viewPos - headerSize(), clampedPos, viewPos));
+ if (headerPositioning == QQuickListView::OverlayHeader) {
+ listItem->setPosition(isContentFlowReversed() ? -position() - size() : position());
+ } else if (visibleItems.count()) {
+ if (headerPositioning == QQuickListView::PullBackHeader) {
+ qreal viewPos = isContentFlowReversed() ? -position() - size() : position();
+ qreal clampedPos = qBound(originPosition() - headerSize(), listItem->position(), lastPosition() - headerSize() - size());
+ listItem->setPosition(qBound(viewPos - headerSize(), clampedPos, viewPos));
+ } else {
+ qreal startPos = originPosition();
+ if (visibleIndex == 0) {
+ listItem->setPosition(startPos - headerSize());
} else {
- qreal startPos = originPosition();
- if (visibleIndex == 0) {
+ if (position() <= startPos || listItem->position() > startPos - headerSize())
listItem->setPosition(startPos - headerSize());
- } else {
- if (position() <= startPos || listItem->position() > startPos - headerSize())
- listItem->setPosition(startPos - headerSize());
- }
}
- } else {
- listItem->setPosition(-headerSize());
}
+ } else {
+ listItem->setPosition(-headerSize());
}
if (created)
@@ -2840,8 +2838,15 @@ void QQuickListView::viewportMoved(Qt::Orientations orient)
{
Q_D(QQuickListView);
QQuickItemView::viewportMoved(orient);
- if (!d->itemCount)
+
+ if (!d->itemCount) {
+ if (d->hasStickyHeader())
+ d->updateHeader();
+ if (d->hasStickyFooter())
+ d->updateFooter();
return;
+ }
+
// Recursion can occur due to refill changing the content size.
if (d->inViewportMoved)
return;
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp
index 456eedd0be..0040843929 100644
--- a/src/quick/items/qquickloader.cpp
+++ b/src/quick/items/qquickloader.cpp
@@ -852,6 +852,11 @@ likelihood of glitches in animation. When loading asynchronously the status
will change to Loader.Loading. Once the entire component has been created, the
\l item will be available and the status will change to Loader.Ready.
+Changing the value of this property to \c false while an asynchronous load is in
+progress will force immediate, synchronous completion. This allows beginning an
+asynchronous load and then forcing completion if the Loader content must be
+accessed before the asynchronous load has completed.
+
To avoid seeing the items loading progressively set \c visible appropriately, e.g.
\code
@@ -878,6 +883,19 @@ void QQuickLoader::setAsynchronous(bool a)
return;
d->asynchronous = a;
+
+ if (!d->asynchronous && isComponentComplete() && d->active) {
+ if (d->loadingFromSource && d->component && d->component->isLoading()) {
+ // Force a synchronous component load
+ QUrl currentSource = d->source;
+ d->clear();
+ d->source = currentSource;
+ loadFromSource();
+ } else if (d->incubator && d->incubator->isLoading()) {
+ d->incubator->forceCompletion();
+ }
+ }
+
emit asynchronousChanged();
}
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 895a616cb7..b89cfe8c04 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -72,7 +72,11 @@ QQuickTextPrivate::QQuickTextPrivate()
, elideMode(QQuickText::ElideNone), hAlign(QQuickText::AlignLeft), vAlign(QQuickText::AlignTop)
, format(QQuickText::AutoText), wrapMode(QQuickText::NoWrap)
, style(QQuickText::Normal)
+#if defined(QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
+ , renderType(QQuickText::QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
+#else
, renderType(QQuickText::QtRendering)
+#endif
, updateType(UpdatePaintNode)
, maximumLineCountValid(false), updateOnComponentComplete(true), richText(false)
, styledText(false), widthExceeded(false), heightExceeded(false), internalWidthUpdate(false)
diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h
index fed0688fd7..a2b4c1ab99 100644
--- a/src/quick/items/qquicktextedit_p_p.h
+++ b/src/quick/items/qquicktextedit_p_p.h
@@ -106,7 +106,11 @@ public:
, quickDocument(0), lastSelectionStart(0), lastSelectionEnd(0), lineCount(0)
, hAlign(QQuickTextEdit::AlignLeft), vAlign(QQuickTextEdit::AlignTop)
, format(QQuickTextEdit::PlainText), wrapMode(QQuickTextEdit::NoWrap)
+#if defined(QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
+ , renderType(QQuickTextEdit::QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
+#else
, renderType(QQuickTextEdit::QtRendering)
+#endif
, contentDirection(Qt::LayoutDirectionAuto)
, mouseSelectionMode(QQuickTextEdit::SelectCharacters)
#ifndef QT_NO_IM
diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h
index 00d9b2b0fa..6aaa630839 100644
--- a/src/quick/items/qquicktextinput_p_p.h
+++ b/src/quick/items/qquicktextinput_p_p.h
@@ -115,7 +115,11 @@ public:
, vAlign(QQuickTextInput::AlignTop)
, wrapMode(QQuickTextInput::NoWrap)
, m_echoMode(QQuickTextInput::Normal)
+#if defined(QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
+ , renderType(QQuickTextInput::QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
+#else
, renderType(QQuickTextInput::QtRendering)
+#endif
, updateType(UpdatePaintNode)
, mouseSelectionMode(QQuickTextInput::SelectCharacters)
, m_layoutDirection(Qt::LayoutDirectionAuto)
diff --git a/src/quick/items/qquicktextnode_p.h b/src/quick/items/qquicktextnode_p.h
index c6a1059e8a..01de0dbf2f 100644
--- a/src/quick/items/qquicktextnode_p.h
+++ b/src/quick/items/qquicktextnode_p.h
@@ -68,7 +68,7 @@ class QSGTexture;
class QQuickTextNodeEngine;
-class QQuickTextNode : public QSGTransformNode
+class Q_QUICK_PRIVATE_EXPORT QQuickTextNode : public QSGTransformNode
{
public:
enum Decoration {
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index 0182f8abfb..d0330398e5 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -79,7 +79,8 @@ QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObje
QQuickItem *item = qobject_cast<QQuickItem *>(ctx);
if (item->window())
setWindow(item->window());
- connect(item, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(windowChanged(QQuickWindow*)));
+
+ qmlobject_connect(item, QQuickItem, SIGNAL(windowChanged(QQuickWindow*)), this, QQuickAnimatorProxyJob, SLOT(windowChanged(QQuickWindow*)));
}
}