aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-16 01:01:37 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-16 01:01:37 +0200
commit67481cae7e1aa6e560eaca94bfa5c14bfa8edc25 (patch)
tree714eb8ce3dfc4816718562b1286b5ca6c711628a
parentbccf872b94944dfa476ccedc1d1a45d380703e15 (diff)
parent383854f482a34cef14f918c2a3172522249ef542 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
-rw-r--r--examples/quick/views/doc/src/views.qdoc16
-rw-r--r--src/imports/testlib/TestCase.qml2
-rw-r--r--src/particles/qquickimageparticle.cpp18
-rw-r--r--src/particles/qquickimageparticle_p.h1
-rw-r--r--src/qml/qml/qqmlbinding.cpp5
-rw-r--r--src/qml/qml/qqmlprivate.h2
-rw-r--r--src/quick/items/qquicktextedit.cpp9
-rw-r--r--src/quick/items/qquicktextinput.cpp4
-rw-r--r--src/quick/items/qquickwindow.cpp45
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/Derived.qml6
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro2
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes10
-rw-r--r--tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir1
-rw-r--r--tests/auto/qml/qqmlbinding/data/nanPropertyToInt.qml14
-rw-r--r--tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp11
-rw-r--r--tests/auto/quick/qquicktextinput/data/qtbug77841.qml22
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp13
-rw-r--r--tools/qmlplugindump/main.cpp68
18 files changed, 173 insertions, 76 deletions
diff --git a/examples/quick/views/doc/src/views.qdoc b/examples/quick/views/doc/src/views.qdoc
index 16237a68e0..3e23f7657a 100644
--- a/examples/quick/views/doc/src/views.qdoc
+++ b/examples/quick/views/doc/src/views.qdoc
@@ -39,13 +39,13 @@
\include examples-run.qdocinc
- \section1 GridView and PathView
+ \section1 Using GridView and PathView
\e GridView and \e PathView demonstrate usage of these types to display
views.
\snippet views/gridview/gridview-example.qml 0
- \section1 Dynamic List
+ \section1 Using Dynamic List
\e{Dynamic List} demonstrates animation of runtime additions and removals to
a \l ListView.
@@ -66,12 +66,12 @@
\snippet views/listview/expandingdelegates.qml 2
\snippet views/listview/expandingdelegates.qml 3
- \section1 Highlight
+ \section1 Using Highlight
\e Highlight demonstrates adding a custom highlight to a ListView.
\snippet views/listview/highlight.qml 0
- \section1 Highlight Ranges
+ \section1 Using Highlight Ranges
\e{Highlight Ranges} shows the three different highlight range modes of
ListView.
@@ -79,13 +79,13 @@
\snippet views/listview/highlightranges.qml 1
\snippet views/listview/highlightranges.qml 2
- \section1 Sections
+ \section1 Using Sections
\e Sections demonstrates the various section headers and footers available
to \l ListView.
\snippet views/listview/sections.qml 0
- \section1 Packages
+ \section1 Using Packages
\e Packages use the \l [QML]{Package} type to transition delegates between
two views.
@@ -100,13 +100,13 @@
\snippet views/package/view.qml 0
- \section1 ObjectModel
+ \section1 Using ObjectModel
\e ObjectModel uses an ObjectModel for the model instead of a \l ListModel.
\snippet views/objectmodel/objectmodel.qml 0
- \section1 Display Margins
+ \section1 Using Display Margins
\e{Display Margins} uses delegates to display items and implements a simple
header and footer components.
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index e7669fd03d..6e075d8792 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -1631,7 +1631,7 @@ Item {
TestCase {
name: "ItemTests"
- when: area.pressed
+ when: windowShown
id: test1
function test_touch() {
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index bd3865f42f..4ce8186c7c 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -1104,6 +1104,7 @@ void fillUniformArrayFromImage(float* array, const QImage& img, int size)
QQuickImageParticle::QQuickImageParticle(QQuickItem* parent)
: QQuickParticlePainter(parent)
, m_color_variation(0.0)
+ , m_outgoingNode(nullptr)
, m_material(nullptr)
, m_alphaVariation(0.0)
, m_alpha(1.0)
@@ -1149,6 +1150,8 @@ void QQuickImageParticle::sceneGraphInvalidated()
{
m_nodes.clear();
m_material = nullptr;
+ delete m_outgoingNode;
+ m_outgoingNode = nullptr;
}
void QQuickImageParticle::setImage(const QUrl &image)
@@ -1931,8 +1934,11 @@ QSGNode *QQuickImageParticle::updatePaintNode(QSGNode *node, UpdatePaintNodeData
}
if (m_pleaseReset){
- if (node)
- delete node;
+ // Cannot just destroy the node and then return null (in case image
+ // loading is still in progress). Rather, keep track of the old node
+ // until we have a new one.
+ delete m_outgoingNode;
+ m_outgoingNode = node;
node = nullptr;
m_lastLevel = perfLevel;
@@ -1946,6 +1952,9 @@ QSGNode *QQuickImageParticle::updatePaintNode(QSGNode *node, UpdatePaintNodeData
m_pleaseReset = false;
m_startedImageLoading = 0;//Cancel a part-way build (may still have a pending load)
+ } else if (!m_material) {
+ delete node;
+ node = nullptr;
}
if (m_system && m_system->isRunning() && !m_system->isPaused()){
@@ -1959,6 +1968,11 @@ QSGNode *QQuickImageParticle::updatePaintNode(QSGNode *node, UpdatePaintNodeData
}
}
+ if (!node) {
+ node = m_outgoingNode;
+ m_outgoingNode = nullptr;
+ }
+
return node;
}
diff --git a/src/particles/qquickimageparticle_p.h b/src/particles/qquickimageparticle_p.h
index 83fc75e9c9..fdb404861c 100644
--- a/src/particles/qquickimageparticle_p.h
+++ b/src/particles/qquickimageparticle_p.h
@@ -390,6 +390,7 @@ private:
QColor m_color;
qreal m_color_variation;
+ QSGNode *m_outgoingNode;
QHash<int, QSGGeometryNode *> m_nodes;
QHash<int, int> m_idxStarts;//TODO: Proper resizing will lead to needing a spriteEngine per particle - do this after sprite engine gains transparent sharing?
QList<QPair<int, int> > m_startsIdx;//Same data, optimized for alternate retrieval
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index 2f6aabf61e..112e5b558a 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -298,8 +298,9 @@ protected:
case QMetaType::Int:
if (result.isInteger())
return doStore<int>(result.integerValue(), pd, flags);
- else if (result.isNumber())
- return doStore<int>(result.doubleValue(), pd, flags);
+ else if (result.isNumber()) {
+ return doStore<int>(QV4::StaticValue::toInteger(result.doubleValue()), pd, flags);
+ }
break;
case QMetaType::Double:
if (result.isNumber())
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index 27dac71571..9504fc37dc 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -62,7 +62,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qvariant.h>
#include <QtCore/qurl.h>
-#include <QPointer>
+#include <QtCore/qpointer.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qdebug.h>
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index c4e9c0d316..7d34cc3f56 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -2060,20 +2060,19 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
firstDirtyPos = nodeIterator->startPos();
// ### this could be optimized if the first and last dirty nodes are not connected
// as the intermediate text nodes would usually only need to be transformed differently.
- int lastDirtyPos = firstDirtyPos;
+ QQuickTextNode *firstCleanNode = nullptr;
auto it = d->textNodeMap.constEnd();
while (it != nodeIterator) {
--it;
- if (it->dirty()) {
- lastDirtyPos = it->startPos();
+ if (it->dirty())
break;
- }
+ firstCleanNode = it->textNode();
}
do {
rootNode->removeChildNode(nodeIterator->textNode());
delete nodeIterator->textNode();
nodeIterator = d->textNodeMap.erase(nodeIterator);
- } while (nodeIterator != d->textNodeMap.constEnd() && nodeIterator->startPos() <= lastDirtyPos);
+ } while (nodeIterator != d->textNodeMap.constEnd() && nodeIterator->textNode() != firstCleanNode);
}
// FIXME: the text decorations could probably be handled separately (only updated for affected textFrames)
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 34105d8c81..a83b9beaa5 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -2259,8 +2259,8 @@ void QQuickTextInput::remove(int start, int end)
d->m_cursor -= qMin(d->m_cursor, end) - start;
if (d->m_selstart > start)
d->m_selstart -= qMin(d->m_selstart, end) - start;
- if (d->m_selend > end)
- d->m_selend -= qMin(d->m_selend, end) - start;
+ if (d->m_selend >= end)
+ d->m_selend -= end - start;
}
d->addCommand(QQuickTextInputPrivate::Command(
QQuickTextInputPrivate::SetSelection, d->m_cursor, 0, d->m_selstart, d->m_selend));
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 0ee93ab6ff..6286a1694a 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -4220,16 +4220,18 @@ QQmlIncubationController *QQuickWindow::incubationController() const
The OpenGL context used for rendering the scene graph will be bound
at this point.
- When using the RHI and a graphics API other than OpenGL, the signal is
- emitted after the preparations for the frame have been done, meaning there
- is a command buffer in recording mode, where applicable. If desired, the
- slot function connected to this signal can query native resources like the
- command before via QSGRendererInterface. Note however that the recording of
- the main render pass is not yet started at this point and it is not
- possible to add commands within that pass. Instead, use
- beforeRenderPassRecording() for that. However, connecting to this signal is
- still important if the recording of copy type of commands is desired since
- those cannot be enqueued within a render pass.
+ When using the RHI, the signal is emitted after the preparations for the
+ frame have been done, meaning there is a command buffer in recording mode,
+ where applicable. If desired, the slot function connected to this signal
+ can query native resources like the command before via
+ QSGRendererInterface. Note however that the recording of the main render
+ pass is not yet started at this point and it is not possible to add
+ commands within that pass. Starting a pass means clearing the color, depth,
+ and stencil buffers so it is not possible to achieve an underlay type of
+ rendering by just connecting to this signal. Rather, connect to
+ beforeRenderPassRecording(). However, connecting to this signal is still
+ important if the recording of copy type of commands is desired since those
+ cannot be enqueued within a render pass.
\warning This signal is emitted from the scene graph rendering thread. If your
slot function needs to finish before execution continues, you must make sure that
@@ -4252,18 +4254,17 @@ QQmlIncubationController *QQuickWindow::incubationController() const
The OpenGL context used for rendering the scene graph will be bound at this point.
- When using the RHI and a graphics API other than OpenGL, the signal is
- emitted after scene graph has added its commands to the command buffer,
- which is not yet submitted to the graphics queue. If desired, the slot
- function connected to this signal can query native resources, like the
- command buffer, before via QSGRendererInterface. Note however that the
- render pass (or passes) are already recorded at this point and it is not
- possible to add more commands within the scenegraph's pass. Instead, use
- afterRenderPassRecording() for that. This signal has therefore limited use
- and is rarely needed in an RHI-based setup. Rather, it is the combination
- of beforeRendering() + beforeRenderPassRecording() or beforeRendering() +
- afterRenderPassRecording() that is typically used to achieve under- or
- overlaying of the custom rendering.
+ When using the RHI, the signal is emitted after scene graph has added its
+ commands to the command buffer, which is not yet submitted to the graphics
+ queue. If desired, the slot function connected to this signal can query
+ native resources, like the command buffer, before via QSGRendererInterface.
+ Note however that the render pass (or passes) are already recorded at this
+ point and it is not possible to add more commands within the scenegraph's
+ pass. Instead, use afterRenderPassRecording() for that. This signal has
+ therefore limited use and is rarely needed in an RHI-based setup. Rather,
+ it is the combination of beforeRendering() + beforeRenderPassRecording() or
+ beforeRendering() + afterRenderPassRecording() that is typically used to
+ achieve under- or overlaying of the custom rendering.
\warning This signal is emitted from the scene graph rendering thread. If your
slot function needs to finish before execution continues, you must make sure that
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/Derived.qml b/tests/auto/qml/qmlplugindump/data/dumper/Imports/Derived.qml
new file mode 100644
index 0000000000..2f0ac401d7
--- /dev/null
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/Derived.qml
@@ -0,0 +1,6 @@
+pragma Singleton
+import dumper.Imports 1.0
+
+Imports {
+ property int something: 2
+}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro
index d20ea967ea..b4bd9baf5b 100644
--- a/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/imports.pro
@@ -17,7 +17,7 @@ HEADERS += \
imports.h
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
- cp.files = qmldir plugins.qmltypes CompositeImports.qml
+ cp.files = qmldir plugins.qmltypes CompositeImports.qml Derived.qml
cp.path = $$OUT_PWD
COPIES += cp
}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes b/tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes
index 937dd60a9e..fb13928ba0 100644
--- a/tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/plugins.qmltypes
@@ -14,4 +14,14 @@ Module {
exports: ["dumper.Imports/Imports 1.0"]
exportMetaObjectRevisions: [0]
}
+ Component {
+ prototype: "Imports"
+ name: "dumper.Imports/Derived 1.0"
+ exports: ["dumper.Imports/Derived 1.0"]
+ exportMetaObjectRevisions: [0]
+ isComposite: true
+ isCreatable: false
+ isSingleton: true
+ Property { name: "something"; type: "int" }
+ }
}
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir b/tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir
index c9058a7f95..f84fca1d75 100644
--- a/tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir
+++ b/tests/auto/qml/qmlplugindump/data/dumper/Imports/qmldir
@@ -1,3 +1,4 @@
module dumper.Imports
plugin Imports
CompositeImports 1.0 CompositeImports.qml
+singleton Derived 1.0 Derived.qml
diff --git a/tests/auto/qml/qqmlbinding/data/nanPropertyToInt.qml b/tests/auto/qml/qqmlbinding/data/nanPropertyToInt.qml
new file mode 100644
index 0000000000..366dbf0464
--- /dev/null
+++ b/tests/auto/qml/qqmlbinding/data/nanPropertyToInt.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.11
+
+Item {
+ visible: true
+ width: 320
+ height: 200
+ property int val: other.val
+
+ Rectangle {
+ id: other
+ anchors.fill: parent;
+ property int val: undefined / 2
+ }
+}
diff --git a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
index 2c2d311ff7..2610402455 100644
--- a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
+++ b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
@@ -56,6 +56,7 @@ private slots:
void bindingOverwriting();
void bindToQmlComponent();
void bindingDoesNoWeirdConversion();
+ void bindNaNToInt();
private:
QQmlEngine engine;
@@ -398,6 +399,16 @@ void tst_qqmlbinding::bindingDoesNoWeirdConversion()
QVERIFY(colorLabel);
}
+//QTBUG-72442
+void tst_qqmlbinding::bindNaNToInt()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("nanPropertyToInt.qml"));
+ QScopedPointer<QQuickItem> item(qobject_cast<QQuickItem*>(c.create()));
+
+ QVERIFY(item != nullptr);
+ QCOMPARE(item->property("val").toInt(), 0);
+}
QTEST_MAIN(tst_qqmlbinding)
#include "tst_qqmlbinding.moc"
diff --git a/tests/auto/quick/qquicktextinput/data/qtbug77841.qml b/tests/auto/quick/qquicktextinput/data/qtbug77841.qml
new file mode 100644
index 0000000000..ebb43a8f82
--- /dev/null
+++ b/tests/auto/quick/qquicktextinput/data/qtbug77841.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.12
+
+Item {
+ id: root
+ width: 600
+ height: 300
+
+ TextInput {
+ id: qwe
+ objectName: "qwe"
+ width: 500
+ height: 100
+ font.pixelSize: 50
+ text: "123456"
+ focus: true
+ }
+
+ Component.onCompleted: {
+ qwe.insert(0, "***")
+ qwe.remove(0, 3)
+ }
+}
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index ed2d535fda..cab4e1145f 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -230,6 +230,7 @@ private slots:
void padding();
void QTBUG_51115_readOnlyResetsSelection();
+ void QTBUG_77814_InsertRemoveNoSelection();
private:
void simulateKey(QWindow *, int key);
@@ -7003,6 +7004,18 @@ void tst_qquicktextinput::QTBUG_51115_readOnlyResetsSelection()
QCOMPARE(obj->selectedText(), QString());
}
+void tst_qquicktextinput::QTBUG_77814_InsertRemoveNoSelection()
+{
+ QQuickView view;
+ view.setSource(testFileUrl("qtbug77841.qml"));
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QQuickTextInput *textInput = view.rootObject()->findChild<QQuickTextInput*>("qwe");
+ QVERIFY(textInput);
+
+ QCOMPARE(textInput->selectedText(), QString());
+}
+
QTEST_MAIN(tst_qquicktextinput)
#include "tst_qquicktextinput.moc"
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 5e999c557a..1556718471 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -380,23 +380,21 @@ public:
relocatableModuleUri = uri;
}
- const QString getExportString(QString qmlTyName, int majorVersion, int minorVersion)
+ QString getExportString(const QQmlType &type, const QmlVersionInfo &versionInfo)
{
- if (qmlTyName.startsWith(relocatableModuleUri + QLatin1Char('/'))) {
- qmlTyName.remove(0, relocatableModuleUri.size() + 1);
- }
- if (qmlTyName.startsWith("./")) {
- qmlTyName.remove(0, 2);
- }
- if (qmlTyName.startsWith(QLatin1Char('/'))) {
- qmlTyName.remove(0, 1);
- }
- const QString exportString = enquote(
- QString("%1 %2.%3").arg(
- qmlTyName,
- QString::number(majorVersion),
- QString::number(minorVersion)));
- return exportString;
+ const QString module = type.module().isEmpty() ? versionInfo.pluginImportUri
+ : type.module();
+ const int majorVersion = type.majorVersion() >= 0 ? type.majorVersion()
+ : versionInfo.majorVersion;
+ const int minorVersion = type.minorVersion() >= 0 ? type.minorVersion()
+ : versionInfo.minorVersion;
+
+ const QString versionedElement = type.elementName()
+ + QString::fromLatin1(" %1.%2").arg(majorVersion).arg(minorVersion);
+
+ return enquote((module == relocatableModuleUri)
+ ? versionedElement
+ : module + QLatin1Char('/') + versionedElement);
}
void writeMetaContent(const QMetaObject *meta, KnownAttributes *knownAttributes = nullptr)
@@ -441,8 +439,9 @@ public:
}
}
- QString getPrototypeNameForCompositeType(const QMetaObject *metaObject, QSet<QByteArray> &defaultReachableNames,
- QList<const QMetaObject *> *objectsToMerge, const QmlVersionInfo &versionInfo)
+ QString getPrototypeNameForCompositeType(
+ const QMetaObject *metaObject, QList<const QMetaObject *> *objectsToMerge,
+ const QmlVersionInfo &versionInfo)
{
auto ty = QQmlMetaType::qmlType(metaObject);
QString prototypeName;
@@ -454,24 +453,28 @@ public:
&& !objectsToMerge->contains(metaObject))
objectsToMerge->append(metaObject);
const QMetaObject *superMetaObject = metaObject->superClass();
- if (!superMetaObject)
+ if (!superMetaObject) {
prototypeName = "QObject";
- else
+ } else {
+ QQmlType superType = QQmlMetaType::qmlType(superMetaObject);
+ if (superType.isValid() && !superType.isComposite())
+ return convertToId(superMetaObject->className());
prototypeName = getPrototypeNameForCompositeType(
- superMetaObject, defaultReachableNames, objectsToMerge, versionInfo);
+ superMetaObject, objectsToMerge, versionInfo);
+ }
} else {
prototypeName = convertToId(metaObject->className());
}
return prototypeName;
}
- void dumpComposite(QQmlEngine *engine, const QList<QQmlType> &compositeType, QSet<QByteArray> &defaultReachableNames, const QmlVersionInfo &versionInfo)
+ void dumpComposite(QQmlEngine *engine, const QList<QQmlType> &compositeType, const QmlVersionInfo &versionInfo)
{
for (const QQmlType &type : compositeType)
- dumpCompositeItem(engine, type, defaultReachableNames, versionInfo);
+ dumpCompositeItem(engine, type, versionInfo);
}
- void dumpCompositeItem(QQmlEngine *engine, const QQmlType &compositeType, QSet<QByteArray> &defaultReachableNames, const QmlVersionInfo &versionInfo)
+ void dumpCompositeItem(QQmlEngine *engine, const QQmlType &compositeType, const QmlVersionInfo &versionInfo)
{
QQmlComponent e(engine, compositeType.sourceUrl());
if (!e.isReady()) {
@@ -492,13 +495,17 @@ public:
QList<const QMetaObject *> objectsToMerge;
KnownAttributes knownAttributes;
// Get C++ base class name for the composite type
- QString prototypeName = getPrototypeNameForCompositeType(mainMeta, defaultReachableNames,
- &objectsToMerge, versionInfo);
+ QString prototypeName = getPrototypeNameForCompositeType(mainMeta, &objectsToMerge,
+ versionInfo);
qml->writeScriptBinding(QLatin1String("prototype"), enquote(prototypeName));
QString qmlTyName = compositeType.qmlTypeName();
- const QString exportString = getExportString(qmlTyName, compositeType.majorVersion(), compositeType.minorVersion());
+ const QString exportString = getExportString(compositeType, versionInfo);
+
+ // TODO: why don't we simply output the compositeType.elementName() here?
+ // That would make more sense, but it would change the format quite a bit.
qml->writeScriptBinding(QLatin1String("name"), exportString);
+
qml->writeArrayBinding(QLatin1String("exports"), QStringList() << exportString);
qml->writeArrayBinding(QLatin1String("exportMetaObjectRevisions"), QStringList() << QString::number(compositeType.minorVersion()));
qml->writeBooleanBinding(QLatin1String("isComposite"), true);
@@ -565,7 +572,7 @@ public:
if (attachedType != meta)
attachedTypeId = convertToId(attachedType);
}
- const QString exportString = getExportString(type.qmlTypeName(), type.majorVersion(), type.minorVersion());
+ const QString exportString = getExportString(type, { QString(), -1, -1, false });
int metaObjectRevision = type.metaObjectRevision();
if (extendedObject) {
// emulate custom metaobjectrevision out of import
@@ -1239,9 +1246,6 @@ int main(int argc, char *argv[])
QSet<const QMetaObject *> uncreatableMetas;
QSet<const QMetaObject *> singletonMetas;
- // QQuickKeyEvent, QQuickPinchEvent, QQuickDropEvent are not exported
- QSet<QByteArray> defaultReachableNames;
-
// this will hold the meta objects we want to dump information of
QSet<const QMetaObject *> metas;
@@ -1370,7 +1374,7 @@ int main(int argc, char *argv[])
QMap<QString, QList<QQmlType>>::const_iterator iter = compositeTypes.constBegin();
for (; iter != compositeTypes.constEnd(); ++iter)
- dumper.dumpComposite(&engine, iter.value(), defaultReachableNames, info);
+ dumper.dumpComposite(&engine, iter.value(), info);
// define QEasingCurve as an extension of QQmlEasingValueType, this way
// properties using the QEasingCurve type get useful type information.