aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-08 21:27:57 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-08 21:27:57 +0100
commit6059f6f2a485ca3dddfedc55536e4f62f349a990 (patch)
treec86f5ec9be36071ec2da7371df03d1478b2a7bf1
parent62cf41dba5d037fb51224814dde12ad174ce4e72 (diff)
parent5cef1f6b505939976684c00e8deee614f2c20928 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
-rw-r--r--src/imports/sharedimage/plugins.qmltypes11
-rw-r--r--src/qmldebug/qqmlenginecontrolclient.cpp31
-rw-r--r--src/qmldebug/qqmlprofilerclient.cpp28
-rw-r--r--src/qmldebug/qqmlprofilerclient_p_p.h2
-rw-r--r--src/quick/items/qquicktext.cpp6
-rw-r--r--src/quick/items/qquicktextedit.cpp6
-rw-r--r--src/quick/items/qquicktextinput.cpp6
-rw-r--r--tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp7
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/BLACKLIST10
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp10
-rw-r--r--tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml4
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp4
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp40
-rw-r--r--tools/qmlcachegen/resourcefilemapper.cpp8
-rw-r--r--tools/qmlcachegen/resourcefilemapper.h1
15 files changed, 110 insertions, 64 deletions
diff --git a/src/imports/sharedimage/plugins.qmltypes b/src/imports/sharedimage/plugins.qmltypes
new file mode 100644
index 0000000000..46fa24df1a
--- /dev/null
+++ b/src/imports/sharedimage/plugins.qmltypes
@@ -0,0 +1,11 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable Qt.labs.sharedimage 1.0'
+
+Module {
+ dependencies: ["QtQuick 2.8"]
+}
diff --git a/src/qmldebug/qqmlenginecontrolclient.cpp b/src/qmldebug/qqmlenginecontrolclient.cpp
index fef4c81d93..8d62fafb94 100644
--- a/src/qmldebug/qqmlenginecontrolclient.cpp
+++ b/src/qmldebug/qqmlenginecontrolclient.cpp
@@ -108,32 +108,37 @@ void QQmlEngineControlClient::messageReceived(const QByteArray &data)
if (!stream.atEnd())
stream >> name;
- QQmlEngineControlClientPrivate::EngineState &state = d->blockedEngines[id];
- Q_ASSERT(state.blockers == 0);
- Q_ASSERT(state.releaseCommand == QQmlEngineControlClientPrivate::InvalidCommand);
+ auto handleWaiting = [&](
+ QQmlEngineControlClientPrivate::CommandType command, std::function<void()> emitter) {
+ QQmlEngineControlClientPrivate::EngineState &state = d->blockedEngines[id];
+ Q_ASSERT(state.blockers == 0);
+ Q_ASSERT(state.releaseCommand == QQmlEngineControlClientPrivate::InvalidCommand);
+ state.releaseCommand = command;
+ emitter();
+ if (state.blockers == 0) {
+ d->sendCommand(state.releaseCommand, id);
+ d->blockedEngines.remove(id);
+ }
+ };
switch (message) {
case QQmlEngineControlClientPrivate::EngineAboutToBeAdded:
- state.releaseCommand = QQmlEngineControlClientPrivate::StartWaitingEngine;
- emit engineAboutToBeAdded(id, name);
+ handleWaiting(QQmlEngineControlClientPrivate::StartWaitingEngine, [&](){
+ emit engineAboutToBeAdded(id, name);
+ });
break;
case QQmlEngineControlClientPrivate::EngineAdded:
emit engineAdded(id, name);
break;
case QQmlEngineControlClientPrivate::EngineAboutToBeRemoved:
- state.releaseCommand = QQmlEngineControlClientPrivate::StopWaitingEngine;
- emit engineAboutToBeRemoved(id, name);
+ handleWaiting(QQmlEngineControlClientPrivate::StopWaitingEngine, [&](){
+ emit engineAboutToBeRemoved(id, name);
+ });
break;
case QQmlEngineControlClientPrivate::EngineRemoved:
emit engineRemoved(id, name);
break;
}
-
- if (state.blockers == 0 &&
- state.releaseCommand != QQmlEngineControlClientPrivate::InvalidCommand) {
- d->sendCommand(state.releaseCommand, id);
- d->blockedEngines.remove(id);
- }
}
QQmlEngineControlClientPrivate::QQmlEngineControlClientPrivate(QQmlDebugConnection *connection) :
diff --git a/src/qmldebug/qqmlprofilerclient.cpp b/src/qmldebug/qqmlprofilerclient.cpp
index 1eaa3e7667..356190f2b0 100644
--- a/src/qmldebug/qqmlprofilerclient.cpp
+++ b/src/qmldebug/qqmlprofilerclient.cpp
@@ -172,6 +172,22 @@ QQmlProfilerClient::QQmlProfilerClient(QQmlDebugConnection *connection,
setRequestedFeatures(features);
connect(d->engineControl.data(), &QQmlEngineControlClient::engineAboutToBeAdded,
this, &QQmlProfilerClient::sendRecordingStatus);
+ connect(d->engineControl.data(), &QQmlEngineControlClient::engineAboutToBeRemoved,
+ this, [d](int engineId) {
+ // We may already be done with that engine. Then we don't need to block it.
+ if (d->trackedEngines.contains(engineId))
+ d->engineControl->blockEngine(engineId);
+ });
+ connect(this, &QQmlProfilerClient::traceFinished,
+ d->engineControl.data(), [d](qint64 timestamp, const QList<int> &engineIds) {
+ Q_UNUSED(timestamp);
+ // The engines might not be blocked because the trace can get finished before engine control
+ // sees them.
+ for (int blocked : d->engineControl->blockedEngines()) {
+ if (engineIds.contains(blocked))
+ d->engineControl->releaseEngine(blocked);
+ }
+ });
}
QQmlProfilerClient::~QQmlProfilerClient()
@@ -200,6 +216,7 @@ void QQmlProfilerClient::clearAll()
Q_D(QQmlProfilerClient);
d->serverTypeIds.clear();
d->eventTypeIds.clear();
+ d->trackedEngines.clear();
clearEvents();
}
@@ -326,12 +343,15 @@ void QQmlProfilerClient::messageReceived(const QByteArray &data)
emit complete(d->maximumTime);
} else if (d->currentEvent.type.message() == Event
&& d->currentEvent.type.detailType() == StartTrace) {
- emit traceStarted(d->currentEvent.event.timestamp(),
- d->currentEvent.event.numbers<QList<int>, qint32>());
+ const QList<int> engineIds = d->currentEvent.event.numbers<QList<int>, qint32>();
+ d->trackedEngines.append(engineIds);
+ emit traceStarted(d->currentEvent.event.timestamp(), engineIds);
} else if (d->currentEvent.type.message() == Event
&& d->currentEvent.type.detailType() == EndTrace) {
- emit traceFinished(d->currentEvent.event.timestamp(),
- d->currentEvent.event.numbers<QList<int>, qint32>());
+ const QList<int> engineIds = d->currentEvent.event.numbers<QList<int>, qint32>();
+ for (int engineId : engineIds)
+ d->trackedEngines.removeAll(engineId);
+ emit traceFinished(d->currentEvent.event.timestamp(), engineIds);
} else if (d->updateFeatures(d->currentEvent.type.feature())) {
d->processCurrentEvent();
}
diff --git a/src/qmldebug/qqmlprofilerclient_p_p.h b/src/qmldebug/qqmlprofilerclient_p_p.h
index b90793d733..99fe47301b 100644
--- a/src/qmldebug/qqmlprofilerclient_p_p.h
+++ b/src/qmldebug/qqmlprofilerclient_p_p.h
@@ -105,6 +105,8 @@ public:
QStack<QQmlProfilerTypedEvent> rangesInProgress;
QQueue<QQmlProfilerEvent> pendingMessages;
QQueue<QQmlProfilerEvent> pendingDebugMessages;
+
+ QList<int> trackedEngines;
};
QT_END_NAMESPACE
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 5f58f0cdde..d601087296 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -1507,9 +1507,9 @@ QQuickText::~QQuickText()
\qmlproperty bool QtQuick::Text::font.kerning
\since 5.10
- Enables or disables the kerning OpenType feature when shaping the text. This may improve performance
- when creating or changing the text, at the expense of some cosmetic features. The default value
- is true.
+ Enables or disables the kerning OpenType feature when shaping the text. Disabling this may
+ improve performance when creating or changing the text, at the expense of some cosmetic
+ features. The default value is true.
\qml
Text { text: "OATS FLAVOUR WAY"; font.kerning: false }
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index f8363b1e5a..10abc1176a 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -358,9 +358,9 @@ QString QQuickTextEdit::text() const
\qmlproperty bool QtQuick::TextEdit::font.kerning
\since 5.10
- Enables or disables the kerning OpenType feature when shaping the text. This may improve performance
- when creating or changing the text, at the expense of some cosmetic features. The default value
- is true.
+ Enables or disables the kerning OpenType feature when shaping the text. Disabling this may
+ improve performance when creating or changing the text, at the expense of some cosmetic
+ features. The default value is true.
\qml
TextEdit { text: "OATS FLAVOUR WAY"; kerning: font.false }
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index d516b6f30c..a09fc35f1c 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -384,9 +384,9 @@ QString QQuickTextInputPrivate::realText() const
\qmlproperty bool QtQuick::TextInput::font.kerning
\since 5.10
- Enables or disables the kerning OpenType feature when shaping the text. This may improve performance
- when creating or changing the text, at the expense of some cosmetic features. The default value
- is true.
+ Enables or disables the kerning OpenType feature when shaping the text. Disabling this may
+ improve performance when creating or changing the text, at the expense of some cosmetic
+ features. The default value is true.
\qml
TextInput { text: "OATS FLAVOUR WAY"; font.kerning: false }
diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
index 18ba133876..a8c43b1c75 100644
--- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
+++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
@@ -113,9 +113,12 @@ void tst_QQmlEngineControl::startEngine()
QTRY_VERIFY(!m_client->blockedEngines().empty());
m_client->releaseEngine(m_client->blockedEngines().last());
+ QVERIFY(m_client->blockedEngines().isEmpty());
QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(engineAdded(int,QString))),
"No engine start message received in time.");
+
+ QVERIFY(m_client->blockedEngines().isEmpty());
}
void tst_QQmlEngineControl::stopEngine_data()
@@ -131,15 +134,19 @@ void tst_QQmlEngineControl::stopEngine()
QTRY_VERIFY(!m_client->blockedEngines().empty());
m_client->releaseEngine(m_client->blockedEngines().last());
+ QVERIFY(m_client->blockedEngines().isEmpty());
QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(engineAdded(int,QString))),
"No engine start message received in time.");
+ QVERIFY(m_client->blockedEngines().isEmpty());
QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(engineAboutToBeRemoved(int,QString))),
"No engine about to stop message received in time.");
m_client->releaseEngine(m_client->blockedEngines().last());
+ QVERIFY(m_client->blockedEngines().isEmpty());
QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(engineRemoved(int,QString))),
"No engine stop message received in time.");
+ QVERIFY(m_client->blockedEngines().isEmpty());
}
QTEST_MAIN(tst_QQmlEngineControl)
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/BLACKLIST b/tests/auto/qml/debugger/qqmlprofilerservice/BLACKLIST
deleted file mode 100644
index 30e254e164..0000000000
--- a/tests/auto/qml/debugger/qqmlprofilerservice/BLACKLIST
+++ /dev/null
@@ -1,10 +0,0 @@
-# QTBUG-66230
-[profileOnExit]
-osx
-windows
-[translationBinding]
-osx
-windows
-[memory]
-osx
-windows
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index c32fa7ea7d..db28d3202d 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -244,9 +244,10 @@ QQmlDebugTest::ConnectResult tst_QQmlProfilerService::connect(
m_isComplete = false;
// ### Still using qmlscene due to QTBUG-33377
- return QQmlDebugTest::connect(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene",
- restrictServices ? QStringLiteral("CanvasFrameRate") : QString(),
- testFile(file), block);
+ return QQmlDebugTest::connect(
+ QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene",
+ restrictServices ? QQmlDebuggingEnabler::profilerServices().join(',') : QString(),
+ testFile(file), block);
}
void tst_QQmlProfilerService::checkProcessTerminated()
@@ -256,7 +257,10 @@ void tst_QQmlProfilerService::checkProcessTerminated()
// cleanly here.
// Wait for the process to finish by itself, if that hasn't happened already
+ QVERIFY(m_client);
+ QVERIFY(m_client->client);
QTRY_COMPARE(m_client->client->state(), QQmlDebugClient::NotConnected);
+ QVERIFY(m_process);
QTRY_COMPARE(m_process->exitStatus(), QProcess::NormalExit);
}
diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml b/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml
index 95ecf702be..7d7f53dd15 100644
--- a/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml
+++ b/tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml
@@ -31,7 +31,7 @@ import Qt.labs.handlers 1.0
Rectangle {
id: root
- width: 500
+ width: 800
height: 480
objectName: "root"
color: "#222222"
@@ -41,7 +41,7 @@ Rectangle {
anchors.margins: 10
anchors.topMargin: 40
contentHeight: 600
- contentWidth: 600
+ contentWidth: 1000
// pressDelay: TODO
Row {
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 9b526f80c5..39a8909617 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -2677,7 +2677,7 @@ void tst_qquicktextinput::copyAndPaste()
QCOMPARE(clipboard->text(), QString("My password"));
clipboard->clear();
} else {
- QVERIFY(clipboard->text().isEmpty());
+ QVERIFY(!clipboard->ownsSelection() || clipboard->text().isEmpty());
}
index++;
}
@@ -2745,7 +2745,7 @@ void tst_qquicktextinput::copyAndPasteKeySequence()
QCOMPARE(clipboard->text(), QString("My password"));
clipboard->clear();
} else {
- QVERIFY(clipboard->text().isEmpty());
+ QVERIFY(!clipboard->ownsClipboard() || clipboard->text().isEmpty());
}
index++;
}
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index 31215daf08..7c04f69a2b 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -442,28 +442,42 @@ int main(int argc, char **argv)
parser.process(app);
+ enum Output {
+ GenerateCpp,
+ GenerateCacheFile,
+ GenerateLoader
+ } target = GenerateCacheFile;
+
+ QString outputFileName;
+ if (parser.isSet(outputFileOption))
+ outputFileName = parser.value(outputFileOption);
+
+ if (outputFileName.endsWith(QLatin1String(".cpp"))) {
+ target = GenerateCpp;
+ if (outputFileName.endsWith(QLatin1String("qmlcache_loader.cpp")))
+ target = GenerateLoader;
+ }
+
const QStringList sources = parser.positionalArguments();
if (sources.isEmpty()){
parser.showHelp();
- } else if (sources.count() > 1) {
+ } else if (sources.count() > 1 && target != GenerateLoader) {
fprintf(stderr, "%s\n", qPrintable(QStringLiteral("Too many input files specified: '") + sources.join(QStringLiteral("' '")) + QLatin1Char('\'')));
return EXIT_FAILURE;
}
- const QString inputFile = sources.first();
- Error error;
-
- QString outputFileName = inputFile + QLatin1Char('c');
- if (parser.isSet(outputFileOption))
- outputFileName = parser.value(outputFileOption);
+ const QString inputFile = sources.first();
+ if (outputFileName.isEmpty())
+ outputFileName = inputFile + QLatin1Char('c');
if (parser.isSet(filterResourceFileOption)) {
return filterResourceFile(inputFile, outputFileName);
}
- if (outputFileName.endsWith(QLatin1String("qmlcache_loader.cpp"))) {
- ResourceFileMapper mapper(inputFile);
+ if (target == GenerateLoader) {
+ ResourceFileMapper mapper(sources);
+ Error error;
if (!generateLoader(mapper.qmlCompilerFiles(), outputFileName, parser.values(resourceFileMappingOption), &error.message)) {
error.augment(QLatin1String("Error generating loader stub: ")).print();
return EXIT_FAILURE;
@@ -474,7 +488,7 @@ int main(int argc, char **argv)
QString inputFileUrl = inputFile;
SaveFunction saveFunction;
- if (outputFileName.endsWith(QLatin1String(".cpp"))) {
+ if (target == GenerateCpp) {
ResourceFileMapper fileMapper(parser.values(resourceOption));
QString inputResourcePath = parser.value(resourcePathOption);
@@ -523,18 +537,20 @@ int main(int argc, char **argv)
if (inputFile.endsWith(QLatin1String(".qml"))) {
+ Error error;
if (!compileQmlFile(inputFile, saveFunction, &error)) {
error.augment(QLatin1String("Error compiling qml file: ")).print();
return EXIT_FAILURE;
}
} else if (inputFile.endsWith(QLatin1String(".js"))) {
+ Error error;
if (!compileJSFile(inputFile, inputFileUrl, saveFunction, &error)) {
error.augment(QLatin1String("Error compiling qml file: ")).print();
return EXIT_FAILURE;
}
} else {
- fprintf(stderr, "Ignoring %s input file as it is not QML source code - maybe remove from QML_FILES?\n", qPrintable(inputFile)); }
-
+ fprintf(stderr, "Ignoring %s input file as it is not QML source code - maybe remove from QML_FILES?\n", qPrintable(inputFile));
+ }
return EXIT_SUCCESS;
}
diff --git a/tools/qmlcachegen/resourcefilemapper.cpp b/tools/qmlcachegen/resourcefilemapper.cpp
index d7daf33de8..c2fd057541 100644
--- a/tools/qmlcachegen/resourcefilemapper.cpp
+++ b/tools/qmlcachegen/resourcefilemapper.cpp
@@ -42,14 +42,6 @@ ResourceFileMapper::ResourceFileMapper(const QStringList &resourceFiles)
}
}
-ResourceFileMapper::ResourceFileMapper(const QString &resourceFile)
-{
- QFile f(resourceFile);
- if (!f.open(QIODevice::ReadOnly))
- return;
- populateFromQrcFile(f);
-}
-
bool ResourceFileMapper::isEmpty() const
{
return qrcPathToFileSystemPath.isEmpty();
diff --git a/tools/qmlcachegen/resourcefilemapper.h b/tools/qmlcachegen/resourcefilemapper.h
index f6e82bacb0..2e0ab45171 100644
--- a/tools/qmlcachegen/resourcefilemapper.h
+++ b/tools/qmlcachegen/resourcefilemapper.h
@@ -35,7 +35,6 @@
struct ResourceFileMapper
{
ResourceFileMapper(const QStringList &resourceFiles);
- ResourceFileMapper(const QString &resourceFile);
bool isEmpty() const;