diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-06 16:12:40 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-06 16:12:41 +0100 |
commit | 24e2b39e7a06687322a18a158a083eb51a7c0dca (patch) | |
tree | 1a32caf6dd6db74fbac9553a094bb00b216fa678 /src | |
parent | 39540124dd0900e0c99dcda8c0ebdf4f3cea8d5e (diff) | |
parent | daff5f2988cef31442629a48c3b3088abf01837a (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: If9a205bea219b9aca95d78b1e556ca9bbff58dd0
Diffstat (limited to 'src')
53 files changed, 315 insertions, 264 deletions
diff --git a/src/imports/dialogs/plugin.cpp b/src/imports/dialogs/plugin.cpp index 44df1447d1..70e12093b6 100644 --- a/src/imports/dialogs/plugin.cpp +++ b/src/imports/dialogs/plugin.cpp @@ -180,7 +180,7 @@ protected: // If there is a qmldir and we have a QApplication instance (as opposed to a // widget-free QGuiApplication), assume that the widget-based dialog will work. if (hasTopLevelWindows && widgetsDir.exists("qmldir") && - !qstrcmp(QCoreApplication::instance()->metaObject()->className(), "QApplication")) { + QCoreApplication::instance()->inherits("QApplication")) { QUrl dialogQmlPath = m_useResources ? QUrl(QString("qrc:/QtQuick/Dialogs/Widget%1.qml").arg(qmlName)) : QUrl::fromLocalFile(qmlDir.filePath(QString("Widget%1.qml").arg(qmlName))); diff --git a/src/imports/dialogs/qquickabstractcolordialog.cpp b/src/imports/dialogs/qquickabstractcolordialog.cpp index abac997ca6..1931bde905 100644 --- a/src/imports/dialogs/qquickabstractcolordialog.cpp +++ b/src/imports/dialogs/qquickabstractcolordialog.cpp @@ -70,6 +70,11 @@ void QQuickAbstractColorDialog::setVisible(bool v) m_dlgHelper->setCurrentColor(m_color); } QQuickAbstractDialog::setVisible(v); + // QTBUG-35206 +#if defined(Q_OS_WIN) + if (m_dialogWindow) + m_dialogWindow->setWidth(m_dialogWindow->width() + 1); +#endif } void QQuickAbstractColorDialog::setModality(Qt::WindowModality m) diff --git a/src/imports/dialogs/qquickabstractfiledialog.cpp b/src/imports/dialogs/qquickabstractfiledialog.cpp index 3a0d5baa83..0cac801311 100644 --- a/src/imports/dialogs/qquickabstractfiledialog.cpp +++ b/src/imports/dialogs/qquickabstractfiledialog.cpp @@ -56,6 +56,7 @@ QQuickAbstractFileDialog::QQuickAbstractFileDialog(QObject *parent) , m_selectMultiple(false) , m_selectFolder(false) { + updateModes(); connect(this, SIGNAL(accepted()), this, SIGNAL(selectionAccepted())); } diff --git a/src/particles/qquickparticlesystem.cpp b/src/particles/qquickparticlesystem.cpp index b95b084756..429a423c17 100644 --- a/src/particles/qquickparticlesystem.cpp +++ b/src/particles/qquickparticlesystem.cpp @@ -193,7 +193,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlParticlesDebug, QML_PARTICLES_DEBUG) Stops the simulation if it is running, and then starts it. - \sa stop, restart, running + \sa start, stop, running */ /*! \qmlmethod QtQuick.Particles::ParticleSystem::reset() diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.cpp b/src/plugins/accessible/quick/qaccessiblequickitem.cpp index 12884ffa4f..9e8c2a6020 100644 --- a/src/plugins/accessible/quick/qaccessiblequickitem.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickitem.cpp @@ -154,15 +154,21 @@ QAccessible::State QAccessibleQuickItem::state() const { QAccessible::State state; - if (item()->hasActiveFocus()) + if (item()->hasActiveFocus()) { + state.focusable = true; state.focused = true; + } + + if (item()->activeFocusOnTab()) + state.focusable = true; - if (!item()->window() ||!item()->isVisible() || qFuzzyIsNull(item()->opacity())) + if (!item()->window() || !item()->window()->isVisible() ||!item()->isVisible() || qFuzzyIsNull(item()->opacity())) state.invisible = true; QAccessible::Role r = role(); switch (r) { case QAccessible::Button: { + state.focusable = true; QVariant checkable = item()->property("checkable"); if (!checkable.toBool()) break; @@ -170,10 +176,20 @@ QAccessible::State QAccessibleQuickItem::state() const } case QAccessible::CheckBox: case QAccessible::RadioButton: { + state.focusable = true; state.checkable = true; state.checked = item()->property("checked").toBool(); break; } + case QAccessible::MenuItem: + case QAccessible::PageTab: + case QAccessible::EditableText: + case QAccessible::SpinBox: + case QAccessible::ComboBox: + case QAccessible::Terminal: + case QAccessible::ScrollBar: + state.focusable = true; + break; default: break; } diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp index 8809221abe..13b23fde68 100644 --- a/src/qml/compiler/qqmlcodegenerator.cpp +++ b/src/qml/compiler/qqmlcodegenerator.cpp @@ -1347,38 +1347,29 @@ static V4IR::Type resolveQmlType(QQmlEnginePrivate *qmlEngine, V4IR::MemberExpre V4IR::Type result = V4IR::VarType; QQmlType *type = static_cast<QQmlType*>(resolver->data); - if (type->isSingleton()) { - if (type->isCompositeSingleton()) { - QQmlTypeData *tdata = qmlEngine->typeLoader.getType(type->singletonInstanceInfo()->url); - Q_ASSERT(tdata); - Q_ASSERT(tdata->isComplete()); - initMetaObjectResolver(resolver, qmlEngine->propertyCacheForType(tdata->compiledData()->metaTypeId)); - resolver->flags |= AllPropertiesAreFinal; - } else { - const QMetaObject *singletonMo = type->singletonInstanceInfo()->instanceMetaObject; - if (!singletonMo) { // We can only accelerate C++ singletons that were registered with their meta-type - resolver->clear(); - return result; - } - initMetaObjectResolver(resolver, qmlEngine->cache(singletonMo)); - resolver->flags |= LookupsIncludeEnums; + + if (member->name->constData()->isUpper()) { + bool ok = false; + int value = type->enumValue(*member->name, &ok); + if (ok) { + member->setEnumValue(value); + resolver->clear(); + return V4IR::SInt32Type; } + } + + if (type->isCompositeSingleton()) { + QQmlTypeData *tdata = qmlEngine->typeLoader.getType(type->singletonInstanceInfo()->url); + Q_ASSERT(tdata); + Q_ASSERT(tdata->isComplete()); + initMetaObjectResolver(resolver, qmlEngine->propertyCacheForType(tdata->compiledData()->metaTypeId)); + resolver->flags |= AllPropertiesAreFinal; + return resolver->resolveMember(qmlEngine, resolver, member); + } else if (const QMetaObject *attachedMeta = type->attachedPropertiesType()) { + QQmlPropertyCache *cache = qmlEngine->cache(attachedMeta); + initMetaObjectResolver(resolver, cache); + member->setAttachedPropertiesId(type->attachedPropertiesId()); return resolver->resolveMember(qmlEngine, resolver, member); - } else { - if (member->name->constData()->isUpper()) { - bool ok = false; - int value = type->enumValue(*member->name, &ok); - if (ok) { - member->setEnumValue(value); - resolver->clear(); - return V4IR::SInt32Type; - } - } else if (const QMetaObject *attachedMeta = type->attachedPropertiesType()) { - QQmlPropertyCache *cache = qmlEngine->cache(attachedMeta); - initMetaObjectResolver(resolver, cache); - member->setAttachedPropertiesId(type->attachedPropertiesId()); - return resolver->resolveMember(qmlEngine, resolver, member); - } } resolver->clear(); @@ -1559,8 +1550,10 @@ V4IR::Expr *JSCodeGen::fallbackNameLookup(const QString &name, int line, int col V4IR::Temp *result = _block->TEMP(_block->newTemp()); _block->MOVE(result, s); result = _block->TEMP(result->index); - initMetaObjectResolver(&result->memberResolver, mapping.type); - result->memberResolver.flags |= AllPropertiesAreFinal; + if (mapping.type) { + initMetaObjectResolver(&result->memberResolver, mapping.type); + result->memberResolver.flags |= AllPropertiesAreFinal; + } result->isReadOnly = true; // don't allow use as lvalue return result; } @@ -1573,14 +1566,14 @@ V4IR::Expr *JSCodeGen::fallbackNameLookup(const QString &name, int line, int col } else if (r.type) { V4IR::Name *typeName = _block->NAME(name, line, col); // Make sure the run-time loads this through the more efficient singleton getter. - typeName->qmlSingleton = r.type->isSingleton(); + typeName->qmlSingleton = r.type->isCompositeSingleton(); typeName->freeOfSideEffects = true; - V4IR::Temp *result = _block->TEMP(_block->newTemp()); - initQmlTypeResolver(&result->memberResolver, r.type); - _block->MOVE(result, typeName); - return _block->TEMP(result->index); + + result = _block->TEMP(result->index); + initQmlTypeResolver(&result->memberResolver, r.type); + return result; } else { Q_ASSERT(r.importNamespace); V4IR::Name *namespaceName = _block->NAME(name, line, col); diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index eccdfff623..679cf1b3a7 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -39,6 +39,10 @@ ** ****************************************************************************/ +#ifndef QT_NO_DEBUG +# define _LIBCPP_DEBUG2 0 +#endif // QT_NO_DEBUG + #include "qv4ssa_p.h" #include "qv4isel_util_p.h" #include "qv4util_p.h" @@ -256,71 +260,88 @@ inline Temp *unescapableTemp(Expr *e, bool variablesCanEscape) } class DominatorTree { + typedef int BasicBlockIndex; + enum { InvalidBasicBlockIndex = -1 }; + + const QVector<BasicBlock *> nodes; int N; - QHash<BasicBlock *, int> dfnum; - QVector<BasicBlock *> vertex; - QHash<BasicBlock *, BasicBlock *> parent; - QHash<BasicBlock *, BasicBlock *> ancestor; - QHash<BasicBlock *, BasicBlock *> best; - QHash<BasicBlock *, BasicBlock *> semi; - QHash<BasicBlock *, BasicBlock *> idom; - QHash<BasicBlock *, BasicBlock *> samedom; - QHash<BasicBlock *, QSet<BasicBlock *> > bucket; + std::vector<int> dfnum; // BasicBlock index -> dfnum + std::vector<int> vertex; + std::vector<BasicBlockIndex> parent; // BasicBlock index -> parent BasicBlock index + std::vector<BasicBlockIndex> ancestor; // BasicBlock index -> ancestor BasicBlock index + std::vector<BasicBlockIndex> best; // BasicBlock index -> best BasicBlock index + std::vector<BasicBlockIndex> semi; // BasicBlock index -> semi dominator BasicBlock index + std::vector<BasicBlockIndex> idom; // BasicBlock index -> immediate dominator BasicBlock index + std::vector<BasicBlockIndex> samedom; // BasicBlock index -> same dominator BasicBlock index + std::vector<QSet<BasicBlock *> > DF; // BasicBlock index -> dominator frontier struct DFSTodo { - BasicBlock *node, *parent; + BasicBlockIndex node, parent; + + DFSTodo() + : node(InvalidBasicBlockIndex) + , parent(InvalidBasicBlockIndex) + {} - DFSTodo():node(0),parent(0){} - DFSTodo(BasicBlock *node, BasicBlock *parent):node(node),parent(parent){} + DFSTodo(BasicBlockIndex node, BasicBlockIndex parent) + : node(node) + , parent(parent) + {} }; - void DFS(BasicBlock *node) { - QVector<DFSTodo> worklist; - worklist.reserve(vertex.capacity()); - DFSTodo todo(node, 0); + void DFS(BasicBlockIndex node) { + std::vector<DFSTodo> worklist; + worklist.reserve(vertex.capacity() / 2); + DFSTodo todo(node, InvalidBasicBlockIndex); while (true) { - BasicBlock *n = todo.node; + BasicBlockIndex n = todo.node; if (dfnum[n] == 0) { dfnum[n] = N; vertex[N] = n; parent[n] = todo.parent; ++N; - for (int i = n->out.size() - 1; i > 0; --i) - worklist.append(DFSTodo(n->out[i], n)); + const QVector<BasicBlock *> &out = nodes[n]->out; + for (int i = out.size() - 1; i > 0; --i) + worklist.push_back(DFSTodo(out[i]->index, n)); - if (n->out.size() > 0) { - todo.node = n->out.first(); + if (out.size() > 0) { + todo.node = out.first()->index; todo.parent = n; continue; } } - if (worklist.isEmpty()) + if (worklist.empty()) break; - todo = worklist.last(); - worklist.removeLast(); + todo = worklist.back(); + worklist.pop_back(); } + +#if defined(SHOW_SSA) + for (int i = 0; i < nodes.size(); ++i) + qDebug("\tL%d: dfnum = %d, parent = %d", i, dfnum[i], parent[i]); +#endif // SHOW_SSA } - BasicBlock *ancestorWithLowestSemi(BasicBlock *v) { - QVector<BasicBlock *> worklist; - worklist.reserve(vertex.capacity()); - for (BasicBlock *it = v; it; it = ancestor[it]) - worklist.append(it); + BasicBlockIndex ancestorWithLowestSemi(BasicBlockIndex v) { + std::vector<BasicBlockIndex> worklist; + worklist.reserve(vertex.capacity() / 2); + for (BasicBlockIndex it = v; it != InvalidBasicBlockIndex; it = ancestor[it]) + worklist.push_back(it); if (worklist.size() < 2) return best[v]; - BasicBlock *b = 0; - BasicBlock *last = worklist.last(); + BasicBlockIndex b = InvalidBasicBlockIndex; + BasicBlockIndex last = worklist.back(); for (int it = worklist.size() - 2; it >= 0; --it) { - BasicBlock *bbIt = worklist[it]; + BasicBlockIndex bbIt = worklist[it]; ancestor[bbIt] = last; - BasicBlock *&best_it = best[bbIt]; - if (b && dfnum[semi[b]] < dfnum[semi[best_it]]) + BasicBlockIndex &best_it = best[bbIt]; + if (b != InvalidBasicBlockIndex && dfnum[semi[b]] < dfnum[semi[best_it]]) best_it = b; else b = best_it; @@ -328,66 +349,82 @@ class DominatorTree { return b; } - void link(BasicBlock *p, BasicBlock *n) { + void link(BasicBlockIndex p, BasicBlockIndex n) { ancestor[n] = p; best[n] = n; } - void calculateIDoms(const QVector<BasicBlock *> &nodes) { + void calculateIDoms() { Q_ASSERT(nodes.first()->in.isEmpty()); - vertex.resize(nodes.size()); - foreach (BasicBlock *n, nodes) { - dfnum[n] = 0; - semi[n] = 0; - ancestor[n] = 0; - idom[n] = 0; - samedom[n] = 0; - } - DFS(nodes.first()); + vertex = std::vector<int>(nodes.size(), InvalidBasicBlockIndex); + parent = std::vector<int>(nodes.size(), InvalidBasicBlockIndex); + dfnum = std::vector<int>(nodes.size(), 0); + semi = std::vector<BasicBlockIndex>(nodes.size(), InvalidBasicBlockIndex); + ancestor = std::vector<BasicBlockIndex>(nodes.size(), InvalidBasicBlockIndex); + idom = std::vector<BasicBlockIndex>(nodes.size(), InvalidBasicBlockIndex); + samedom = std::vector<BasicBlockIndex>(nodes.size(), InvalidBasicBlockIndex); + best = std::vector<BasicBlockIndex>(nodes.size(), InvalidBasicBlockIndex); + + QHash<BasicBlockIndex, std::vector<BasicBlockIndex> > bucket; + + DFS(nodes.first()->index); Q_ASSERT(N == nodes.size()); // fails with unreachable nodes, but those should have been removed before. for (int i = N - 1; i > 0; --i) { - BasicBlock *n = vertex[i]; - BasicBlock *p = parent[n]; - BasicBlock *s = p; - - foreach (BasicBlock *v, n->in) { - BasicBlock *ss; - if (dfnum[v] <= dfnum[n]) - ss = v; + BasicBlockIndex n = vertex[i]; + BasicBlockIndex p = parent[n]; + BasicBlockIndex s = p; + + foreach (BasicBlock *v, nodes.at(n)->in) { + BasicBlockIndex ss = InvalidBasicBlockIndex; + if (dfnum[v->index] <= dfnum[n]) + ss = v->index; else - ss = semi[ancestorWithLowestSemi(v)]; + ss = semi[ancestorWithLowestSemi(v->index)]; if (dfnum[ss] < dfnum[s]) s = ss; } semi[n] = s; - bucket[s].insert(n); + bucket[s].push_back(n); link(p, n); - foreach (BasicBlock *v, bucket[p]) { - BasicBlock *y = ancestorWithLowestSemi(v); - BasicBlock *semi_v = semi[v]; - if (semi[y] == semi_v) - idom[v] = semi_v; - else - samedom[v] = y; + if (bucket.contains(p)) { + foreach (BasicBlockIndex v, bucket[p]) { + BasicBlockIndex y = ancestorWithLowestSemi(v); + BasicBlockIndex semi_v = semi[v]; + if (semi[y] == semi_v) + idom[v] = semi_v; + else + samedom[v] = y; + } + bucket.remove(p); } - bucket[p].clear(); } + +#if defined(SHOW_SSA) + for (int i = 0; i < nodes.size(); ++i) + qDebug("\tL%d: ancestor = %d, semi = %d, samedom = %d", i, ancestor[i], semi[i], samedom[i]); +#endif // SHOW_SSA + for (int i = 1; i < N; ++i) { - BasicBlock *n = vertex[i]; - Q_ASSERT(ancestor[n] && ((semi[n] && dfnum[ancestor[n]] <= dfnum[semi[n]]) || semi[n] == n)); - Q_ASSERT(bucket[n].isEmpty()); - if (BasicBlock *sdn = samedom[n]) + BasicBlockIndex n = vertex[i]; + Q_ASSERT(n != InvalidBasicBlockIndex); + Q_ASSERT(!bucket.contains(n)); + Q_ASSERT(ancestor[n] != InvalidBasicBlockIndex + && ((semi[n] != InvalidBasicBlockIndex + && dfnum[ancestor[n]] <= dfnum[semi[n]]) || semi[n] == n)); + BasicBlockIndex sdn = samedom[n]; + if (sdn != InvalidBasicBlockIndex) idom[n] = idom[sdn]; } -#ifdef SHOW_SSA +#if defined(SHOW_SSA) qout << "Immediate dominators:" << endl; foreach (BasicBlock *to, nodes) { qout << '\t'; - if (BasicBlock *from = idom.value(to)) - qout << from->index; + BasicBlockIndex from = idom.at(to->index); + if (from != InvalidBasicBlockIndex) + qout << from; else qout << "(none)"; qout << " -> " << to->index << endl; @@ -396,55 +433,72 @@ class DominatorTree { } struct NodeProgress { - QSet<BasicBlock *> children; - QSet<BasicBlock *> todo; + std::vector<BasicBlockIndex> children; + std::vector<BasicBlockIndex> todo; }; - void computeDF(const QVector<BasicBlock *> &nodes) { - QHash<BasicBlock *, NodeProgress> nodeStatus; + void computeDF() { + // compute children of each node in the dominator tree + std::vector<std::vector<BasicBlockIndex> > children; // BasicBlock index -> children + children.resize(nodes.size()); + foreach (BasicBlock *n, nodes) { + const BasicBlockIndex nodeIndex = n->index; + Q_ASSERT(nodes.at(nodeIndex) == n); + const BasicBlockIndex nodeDominator = idom[nodeIndex]; + if (nodeDominator == InvalidBasicBlockIndex) + continue; // there is no dominator to add this node to as a child (e.g. the start node) + children[nodeDominator].push_back(nodeIndex); + } + + // Fill the worklist and initialize the node status for each basic-block + QHash<BasicBlockIndex, NodeProgress> nodeStatus; nodeStatus.reserve(nodes.size()); - QVector<BasicBlock *> worklist; + std::vector<BasicBlockIndex> worklist; worklist.reserve(nodes.size() * 2); for (int i = 0, ei = nodes.size(); i != ei; ++i) { - BasicBlock *node = nodes[i]; - worklist.append(node); - NodeProgress &np = nodeStatus[node]; - np.children = children[node]; - np.todo = children[node]; + BasicBlockIndex nodeIndex = nodes[i]->index; + worklist.push_back(nodeIndex); + NodeProgress &np = nodeStatus[nodeIndex]; + np.children = children[nodeIndex]; + np.todo = children[nodeIndex]; } - while (!worklist.isEmpty()) { - BasicBlock *node = worklist.last(); + std::vector<bool> DF_done(nodes.size(), false); + + while (!worklist.empty()) { + BasicBlockIndex node = worklist.back(); - if (DF.contains(node)) { - worklist.removeLast(); + if (DF_done[node]) { + worklist.pop_back(); continue; } NodeProgress &np = nodeStatus[node]; - QSet<BasicBlock *>::iterator it = np.todo.begin(); + std::vector<BasicBlockIndex>::iterator it = np.todo.begin(); while (it != np.todo.end()) { - if (DF.contains(*it)) { + if (DF_done[*it]) { it = np.todo.erase(it); } else { - worklist.append(*it); + worklist.push_back(*it); break; } } - if (np.todo.isEmpty()) { + if (np.todo.empty()) { QSet<BasicBlock *> S; - foreach (BasicBlock *y, node->out) - if (idom[y] != node) - if (!S.contains(y)) - S.insert(y); - foreach (BasicBlock *child, np.children) - foreach (BasicBlock *w, DF[child]) - if (!dominates(node, w) || node == w) - if (!S.contains(w)) - S.insert(w); - DF.insert(node, S); - worklist.removeLast(); + foreach (BasicBlock *y, nodes[node]->out) + if (idom[y->index] != node) + S.insert(y); + foreach (BasicBlockIndex child, np.children) { + foreach (BasicBlock *w, DF[child]) { + const BasicBlockIndex wIndex = w->index; + if (node == wIndex || !dominates(node, w->index)) + S.insert(w); + } + } + DF[node] = S; + DF_done[node] = true; + worklist.pop_back(); } } @@ -452,7 +506,7 @@ class DominatorTree { qout << "Dominator Frontiers:" << endl; foreach (BasicBlock *n, nodes) { qout << "\tDF[" << n->index << "]: {"; - QList<BasicBlock *> SList = DF[n].values(); + QList<BasicBlock *> SList = DF[n->index].values(); for (int i = 0; i < SList.size(); ++i) { if (i > 0) qout << ", "; @@ -463,7 +517,7 @@ class DominatorTree { #endif // SHOW_SSA #if !defined(QT_NO_DEBUG) && defined(CAN_TAKE_LOSTS_OF_TIME) foreach (BasicBlock *n, nodes) { - foreach (BasicBlock *fBlock, DF[n]) { + foreach (BasicBlock *fBlock, DF[n->index]) { Q_ASSERT(!dominates(n, fBlock) || fBlock == n); bool hasDominatedSucc = false; foreach (BasicBlock *succ, fBlock->in) { @@ -473,7 +527,7 @@ class DominatorTree { } } if (!hasDominatedSucc) { - qout << fBlock->index << " in DF[" << n->index << "] has no dominated predecessors" << endl; + qout << fBlock << " in DF[" << n->index << "] has no dominated predecessors" << endl; } Q_ASSERT(hasDominatedSucc); } @@ -481,35 +535,33 @@ class DominatorTree { #endif // !QT_NO_DEBUG } - QHash<BasicBlock *, QSet<BasicBlock *> > children; - QHash<BasicBlock *, QSet<BasicBlock *> > DF; - public: DominatorTree(const QVector<BasicBlock *> &nodes) - : N(0) + : nodes(nodes) + , N(0) { - calculateIDoms(nodes); - - // compute children of n - foreach (BasicBlock *n, nodes) { - QSet<BasicBlock *> &c = children[idom[n]]; - if (!c.contains(n)) - c.insert(n); - } - - computeDF(nodes); + DF.resize(nodes.size()); + calculateIDoms(); + computeDF(); } QSet<BasicBlock *> operator[](BasicBlock *n) const { - return DF[n]; + return DF[n->index]; } BasicBlock *immediateDominator(BasicBlock *bb) const { - return idom[bb]; + return nodes[idom[bb->index]]; } bool dominates(BasicBlock *dominator, BasicBlock *dominated) const { - for (BasicBlock *it = dominated; it; it = idom[it]) { + // The index of the basic blocks might have changed, or the nodes array might have changed, + // or the block got deleted, so get the index from our copy of the array. + return dominates(nodes.indexOf(dominator), nodes.indexOf(dominated)); + } + +private: + bool dominates(BasicBlockIndex dominator, BasicBlockIndex dominated) const { + for (BasicBlockIndex it = dominated; it != InvalidBasicBlockIndex; it = idom[it]) { if (it == dominator) return true; } @@ -1581,7 +1633,8 @@ public: BasicBlock *bb = function->basicBlocks[i]; if (i == 0 || !bb->in.isEmpty()) foreach (Stmt *s, bb->statements) - _worklist.insert(s); + if (!s->asJump()) + _worklist.insert(s); } while (!_worklist.isEmpty()) { @@ -2687,6 +2740,11 @@ namespace { /// Important: this assumes that there are no critical edges in the control-flow graph! void purgeBB(BasicBlock *bb, Function *func, DefUsesCalculator &defUses, QVector<Stmt *> &W) { + // TODO: change this to mark the block as deleted, but leave it alone so that other references + // won't be dangling pointers. + // TODO: after the change above: if we keep on detaching the block from predecessors or + // successors, update the DominatorTree too. + // don't purge blocks that are entry points for catch statements. They might not be directly // connected, but are required anyway if (bb->isExceptionHandler) @@ -2826,6 +2884,8 @@ void optimizeSSA(Function *function, DefUsesCalculator &defUses) foreach (BasicBlock *bb, function->basicBlocks) { for (int i = 0, ei = bb->statements.size(); i != ei; ++i) { Stmt **s = &bb->statements[i]; + if ((*s)->asJump()) + continue; // nothing do do there W.append(*s); ref.insert(*s, s); } diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf index 74aaae7724..43dbe2525c 100644 --- a/src/qml/doc/qtqml.qdocconf +++ b/src/qml/doc/qtqml.qdocconf @@ -34,7 +34,7 @@ qhp.QtQml.subprojects.qmltypes.sortPages = true tagfile = ../../../doc/qtqml/qtqml.tags -depends += qtcore qtxmlpatterns qtgui qtquick qtdoc +depends += qtcore qtxmlpatterns qtgui qtquick qtdoc qtlinguist headerdirs += .. \ ../../imports/models diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc index d3662fb210..5d70cb5174 100644 --- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc +++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc @@ -477,7 +477,7 @@ MessageBoard { As with property values and method parameters, a signal parameter must have a type that is supported by the QML engine; see -\l {Semantics of Data Transfer from C++ to QML}. (Using an +\l {Data Type Conversion Between QML and C++}. (Using an unregistered type will not generate an error, but the parameter value will not be accessible from the handler.) diff --git a/src/qml/doc/src/javascript/qmlglobalobject.qdoc b/src/qml/doc/src/javascript/qmlglobalobject.qdoc index cbffcddb7b..4329bbb351 100644 --- a/src/qml/doc/src/javascript/qmlglobalobject.qdoc +++ b/src/qml/doc/src/javascript/qmlglobalobject.qdoc @@ -38,7 +38,7 @@ additional imports: \li The \l{QmlGlobalQtObject}{Qt object}: This object is specific to QML, and provides helper methods and properties specific to the QML environment. \li qsTr(), qsTranslate(), qsTrId(), QT_TR_NOOP(), QT_TRANSLATE_NOOP(), and QT_TRID_NOOP() functions: - These functions are specific to QML, and provide \l{Translation}{translation capabilities} to the QML environment. + These functions are specific to QML, and provide \l{Overview of the Translation Process}{translation capabilities} to the QML environment. \li gc() function: This function is specific to QML, and provides a way to manually trigger garbage collection. \li print() function: This function is specific to QML, and provides a simple way to output information to the console. \li The \l{Console API}{console object}: This object implements a subset of the \l{http://getfirebug.com/wiki/index.php/Console_API}{FireBug Console API}. diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 679f7bac96..19cd3b3f02 100644 --- a/src/qml/doc/src/qmlfunctions.qdoc +++ b/src/qml/doc/src/qmlfunctions.qdoc @@ -42,7 +42,8 @@ specified \a Flags. Current the only supported type info is \c QML_HAS_ATTACHED_PROPERTIES which - declares that the \a Type supports \l {Attached Properties}. + declares that the \a Type supports \l {Attached Properties and Attached Signal Handlers} + {attached properties}. #include <QtQml> to use this macro. */ @@ -51,7 +52,7 @@ \fn void qmlClearTypeRegistrations() \relates QQmlEngine - Clears all stored type registrations, such as those produced with \l qmlRegisterType. + Clears all stored type registrations, such as those produced with \l qmlRegisterType(). Do not call this function while a QQmlEngine exists or behavior will be undefined. Any existing QQmlEngines must be deleted before calling this function. This function diff --git a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc index 870eb21a07..845ca30b4f 100644 --- a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc +++ b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc @@ -79,7 +79,7 @@ with local variables declared in another. \l {QML Documents} include import statements that define the type names and JavaScript files visible to the document. In addition to their use in the QML declaration itself, type names are used by JavaScript code when accessing -\l {Attached Properties} and enumeration values. +\l {Attached Properties and Attached Signal Handlers}{attached properties} and enumeration values. The effect of an import applies to every property binding, and JavaScript function in the QML document, even those in nested inline components. The @@ -123,7 +123,8 @@ directly, without needing any form of object prefix. QML introduces a more structured, object-oriented approach to JavaScript, and consequently does not require the use of the JavaScript \c this property. -Care must be used when accessing \l {Attached Properties} from bindings due +Care must be used when accessing \l {Attached Properties and Attached Signal Handlers} +{attached properties} from bindings due to their interaction with the scope object. Conceptually attached properties exist on \e all objects, even if they only have an effect on a subset of those. Consequently unqualified attached property reads will always resolve to an diff --git a/src/qml/doc/src/qmllanguageref/documents/structure.qdoc b/src/qml/doc/src/qmllanguageref/documents/structure.qdoc index c8176f7e0f..e526e47b00 100644 --- a/src/qml/doc/src/qmllanguageref/documents/structure.qdoc +++ b/src/qml/doc/src/qmllanguageref/documents/structure.qdoc @@ -57,8 +57,8 @@ presentation to the \l{QQmlEngine}{QML engine}, unlike C or C++. The \c import statements do not copy and prepend the code in the document, but instead instruct the QML engine on how to resolve type references found in the document. Any type reference present in a QML document - such as \c -Rectangle and \c ListView - including those made within an \l {Inline -JavaScript}{JavaScript block} or \l {Property Binding}{property +Rectangle and \c ListView - including those made within a \l {JavaScript +Expressions in QML Documents}{JavaScript block} or \l {Property Binding}{property bindings}, are \e resolved based exclusively on the import statements. At least one \c import statement must be present such as \c{import QtQuick 2.0}. diff --git a/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc b/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc index 57d54e27e0..c89d4a3c0d 100644 --- a/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc +++ b/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc @@ -62,7 +62,7 @@ module <ModuleIdentifier> The <ModuleIdentifier> is the (dotted URI notation) identifier for the module, which must match the module's install path. - The \l{qtqml-modules-topic.html#the-module-identifier-directive} + The \l{Identified Modules#Semantics of Identified Modules} {module identifier directive} must be the first line of the file. Exactly one module identifier directive may exist in the \c qmldir file. @@ -113,7 +113,8 @@ internal MyPrivateType MyPrivateType.qml \endcode This is necessary if the module may be imported remotely (see - \l{Remotely Installed Modules}) because if an exported type depends + \l{Identified Modules#Remotely Installed Identified Modules} + {Remotely Installed Identified Modules}) because if an exported type depends on an non-exported type within the module, the engine must also load the non-exported type. diff --git a/src/qml/doc/src/qmllanguageref/modules/topic.qdoc b/src/qml/doc/src/qmllanguageref/modules/topic.qdoc index 597e7b7ca3..9d4173a883 100644 --- a/src/qml/doc/src/qmllanguageref/modules/topic.qdoc +++ b/src/qml/doc/src/qmllanguageref/modules/topic.qdoc @@ -64,15 +64,15 @@ The directory can then be installed into the \l{qtqml-syntax-imports.html#qml-import-path}{QML import path} as a module. Note that defining a module is not the only way to share common QML types -within a project - a simple \l{qtqml-syntax-imports.html#directory-import} +within a project - a simple \l{Importing QML Document Directories} {QML document directory import} may also be used for this purpose. \section1 Supported QML Module Types There are two different types of modules supported by QML: \list -\li \l{qtqml-modules-identifiedmodules.html}{Identified Modules} -\li \l{qtqml-modules-legacymodules.html}{Legacy Modules} (deprecated) +\li \l{Identified Modules} +\li \l{Legacy Modules} (deprecated) \endlist Identified modules explicitly define their identifier and are installed into diff --git a/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc index 1496a1e5c9..0939a460fe 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc @@ -281,7 +281,7 @@ JavaScript resources, please see the in-depth documentation about \section1 QML Import Path -When an \l{qtqml-modules-installedmodules.html}{installed module} is imported, +When an \l{Identified Modules}{identified module} is imported, the QML engine searches the \e{import path} for a matching module. This import path, as returned by QQmlEngine::importPathList(), defines the diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc index 6344d16caa..b9f391e4dc 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc @@ -142,7 +142,7 @@ Rectangle { \section2 Attached Signal Handlers -An \l {attached signal handler} is a signal handler that receives a signal from an \e {attaching type} rather than the object within which the handler is declared. +An \l {Attached Properties and Attached Signal Handlers}{attached signal handler} is a signal handler that receives a signal from an \e {attaching type} rather than the object within which the handler is declared. For example, \c \l {Component::isCompleted}{Component.isCompleted} is an attached signal handler. This handler is often used to execute some JavaScript code when its creation process has been completed, as in the example below: diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc index a0e5202174..f13a4dac1d 100644 --- a/src/qml/doc/src/whatsnew.qdoc +++ b/src/qml/doc/src/whatsnew.qdoc @@ -36,10 +36,10 @@ a summary of the new changes: \list \li New QQmlApplicationEngine convenience class for QML applications. \li New Instantiatior type for generic, dynamic object creation. -\li New properties for \l Qt.application: arguments, name, and version. +\li New properties for \l {Qt::application}{Qt.application}: arguments, name, and version. \li The 'with' statement has been deprecated and is slated for removal in a future version of the language. -\li New \l Qt.platform object with an os property +\li New \l {Qt::platform}{Qt.platform} object with an \c os property \li New \l qmlClearTypeRegistrations() function drops all data from qmlRegisterType() calls \li New \l qmlRegisterType() function for registering composite types. \endlist @@ -48,7 +48,7 @@ a summary of the new changes: The \l{Qt QML Models QML Types}{Qt QML Models} is a new submodule in Qt 5.1 and provides several QML types for handling data with models and lists. These types -replace types such as \l VisualItem, \l VisualDataModel, and \l VisualDataGroup. +replace types such as \l VisualItemModel, \l VisualDataModel, and \l VisualDataGroup. \list \li \l{Qt QML Models QML Types}{Models} diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index d7a1cef3ba..6a0cf0cf6d 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -1089,8 +1089,6 @@ QDateTime QJSValue::toDateTime() const /*! Returns true if this QJSValue is an object of the Date class; otherwise returns false. - - \sa QJSEngine::newDate() */ bool QJSValue::isDate() const { diff --git a/src/qml/qml.pro b/src/qml/qml.pro index d060b2d8c8..d0f655609e 100644 --- a/src/qml/qml.pro +++ b/src/qml/qml.pro @@ -19,7 +19,9 @@ exists("qqml_enable_gcov") { QMAKE_DOCS = $$PWD/doc/qtqml.qdocconf # 2415: variable "xx" of static storage duration was declared but never referenced +# unused variable 'xx' [-Werror,-Wunused-const-variable] intel_icc: WERROR += -ww2415 +clang: WERROR += -Wno-error=unused-const-variable load(qt_module) diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index f07d4bb703..6717c97d88 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -3711,7 +3711,10 @@ bool QQmlCompiler::completeComponentBuild() JSCodeGen::IdMapping m; m.name = o->id; m.idIndex = o->idIndex; - m.type = o->metatype; + if (output->types[o->type].isFullyDynamicType) + m.type = 0; + else + m.type = o->metatype; idMapping << m; } } diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 4a71c1a7e0..21bcd3569c 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -103,34 +103,6 @@ public: }; V8_DEFINE_EXTENSION(QQmlComponentExtension, componentExtension); -/* - Try to do what's necessary for a reasonable display of the type - name, but no more (just enough for the client to do more extensive cleanup). - - Should only be called when debugging is enabled. -*/ -static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) -{ - static const QString qmlMarker(QLatin1String("_QML")); - static const QChar underscore(QLatin1Char('_')); - static const QChar asterisk(QLatin1Char('*')); - QQmlType *type = QQmlMetaType::qmlType(metaObject); - QString typeName = type ? type->qmlTypeName() : QString::fromUtf8(metaObject->className()); - if (!type) { - //### optimize further? - int marker = typeName.indexOf(qmlMarker); - if (marker != -1 && marker < typeName.count() - 1) { - if (typeName[marker + 1] == underscore) { - const QString className = typeName.left(marker) + asterisk; - type = QQmlMetaType::qmlType(QMetaType::type(className.toUtf8())); - if (type) - typeName = type->qmlTypeName(); - } - } - } - return typeName; -} - /*! \class QQmlComponent \since 5.0 diff --git a/src/qml/qml/qqmlfileselector.cpp b/src/qml/qml/qqmlfileselector.cpp index 6ddc2eb2ff..a18b8327b1 100644 --- a/src/qml/qml/qqmlfileselector.cpp +++ b/src/qml/qml/qqmlfileselector.cpp @@ -92,7 +92,7 @@ Q_GLOBAL_STATIC(interceptorSelectorMap, interceptorInstances); trigger this feature unless you have directories with such names inside your project. If a new QQmlFileSelector is set on the engine, the old one will be replaced. Use - \l QQmlFileSelector::get to query or use the existing instance. + \l QQmlFileSelector::get() to query or use the existing instance. */ /*! diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index 41d5de0862..0409b92e89 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -1157,7 +1157,7 @@ ReturnedValue QtObject::method_createComponent(CallContext *ctx) is not present, or is not a valid ISO 3166 code, the most appropriate country is chosen for the specified language. - \sa QtQuick::Locale + \sa Locale */ ReturnedValue QtObject::method_locale(CallContext *ctx) { @@ -1801,7 +1801,7 @@ ReturnedValue GlobalExtensions::method_qsTrNoOp(CallContext *ctx) Creating binary translation (QM) files suitable for use with this function requires passing the \c -idbased option to the \c lrelease tool. - \sa QT_TRID_NOOP, {Internationalization and Localization with Qt Quick} + \sa QT_TRID_NOOP(), {Internationalization and Localization with Qt Quick} */ ReturnedValue GlobalExtensions::method_qsTrId(CallContext *ctx) { diff --git a/src/quick/doc/images/qml-item-canvas-scale.png b/src/quick/doc/images/qml-item-canvas-scale.png Binary files differindex 3b26fde871..5d391fedb8 100644 --- a/src/quick/doc/images/qml-item-canvas-scale.png +++ b/src/quick/doc/images/qml-item-canvas-scale.png diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf index 22880c4086..846da64ea4 100644 --- a/src/quick/doc/qtquick.qdocconf +++ b/src/quick/doc/qtquick.qdocconf @@ -34,7 +34,7 @@ qhp.QtQuick.subprojects.examples.selectors = fake:example tagfile = ../../../doc/qtquick/qtquick.tags -depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtquicklayouts qtdoc qtquickdialogs +depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtquicklayouts qtdoc qtquickdialogs qtsensors qtwidgets headerdirs += .. diff --git a/src/quick/doc/src/advtutorial.qdoc b/src/quick/doc/src/advtutorial.qdoc index be8b397a8e..aa44ef8a85 100644 --- a/src/quick/doc/src/advtutorial.qdoc +++ b/src/quick/doc/src/advtutorial.qdoc @@ -90,7 +90,7 @@ is the \l SystemPalette item. This provides access to the Qt system palette and is used to give the button a more native look-and-feel. Notice the anchors for the \c Item, \c Button and \c Text types are set using -\l {qdeclarativeintroduction.html#dot-properties}{group notation} for readability. +group (dot) notation for readability. \section2 Adding \c Button and \c Block components @@ -360,7 +360,7 @@ Finally, we'll add a cool-looking particle effect to the blocks when they are de \snippet tutorials/samegame/samegame4/content/BoomBlock.qml 3 -To fully understand this you should read the \l Particles documentation, but it's important to note that \c emitRate is set +To fully understand this you should read \l {Using the Qt Quick Particle System}, but it's important to note that \c emitRate is set to zero so that particles are not emitted normally. Also, we extend the \c dying State, which creates a burst of particles by calling the \c burst() method on the particles type. The code for the states now look like this: @@ -419,7 +419,7 @@ Here is the \c saveHighScore() function in \c samegame.js: First we call \c sendHighScore() (explained in the section below) if it is possible to send the high scores to an online database. -Then, we use the \l{QtQuick.LocalStorage 2}{Local Storage API} to maintain a persistent SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabaseSync() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrieval, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. +Then, we use the \l{QtQuick.LocalStorage}{Local Storage API} to maintain a persistent SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabaseSync() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrieval, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. This is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the \c Dialog). This would allow a more themeable dialog that could better present the high scores. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database. @@ -451,9 +451,9 @@ By following this tutorial you've seen how you can write a fully functional appl \list \li Build your application with \l {Qt Quick QML Types}{QML types} -\li Add application logic \l{Using JavaScript Expressions in QML}{with JavaScript code} +\li Add application logic \l{JavaScript Expressions in QML Documents}{with JavaScript code} \li Add animations with \l {Behavior}{Behaviors} and \l{Qt Quick States}{states} -\li Store persistent application data using, for example, \l{QtQuick.LocalStorage 2}{QtQuick.LocalStorage} or \l XMLHttpRequest +\li Store persistent application data using, for example, \l QtQuick.LocalStorage or \l XMLHttpRequest \endlist There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the diff --git a/src/quick/doc/src/concepts/effects/particles.qdoc b/src/quick/doc/src/concepts/effects/particles.qdoc index ec49c6df43..c3262b7082 100644 --- a/src/quick/doc/src/concepts/effects/particles.qdoc +++ b/src/quick/doc/src/concepts/effects/particles.qdoc @@ -46,7 +46,7 @@ \page qtquick-effects-particles.html \title Using the Qt Quick Particle System - Documentation for all Particle System types can be found on the \l{QtQuick.Particles 2}{QtQuick.Particles} module page. + Documentation for all Particle System types can be found on the \l QtQuick.Particles module page. Note that to use types from the particles module, you will need to import the types with the following line: \code diff --git a/src/quick/doc/src/concepts/input/focus.qdoc b/src/quick/doc/src/concepts/input/focus.qdoc index 827f6d85c8..065651c826 100644 --- a/src/quick/doc/src/concepts/input/focus.qdoc +++ b/src/quick/doc/src/concepts/input/focus.qdoc @@ -168,7 +168,7 @@ When a QML \l Item explicitly relinquishes focus (by setting its system does not automatically select another type to receive focus. That is, it is possible for there to be no currently active focus. -See the \l{declarative/keyinteraction/focus}{Keyboard Focus example} for a +See \l{Qt Quick Examples - Key Interaction} for a demonstration of moving keyboard focus between multiple areas using FocusScope types. diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc index 28bbbf1cca..abef6b765b 100644 --- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc +++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc @@ -174,8 +174,8 @@ with list models of QAbstractItemModel type: The above examples use QQmlContext::setContextProperty() to set model values directly in QML components. An alternative to this is to register the C++ model class as a QML type (either -\l{qtqml-registercpptypes.html}{directly} from a C++ entry-point, or within -the initialization function of a \l{qtqml-modules-cppplugins.html} +\l{Defining QML Types from C++}{directly} from a C++ entry-point, or within +the initialization function of a \l{Creating C++ Plugins for QML} {QML C++ plugin}, as shown below). This would allow the model classes to be created directly as types within QML: @@ -215,7 +215,7 @@ ListView { \endtable -See \l {Tutorial: Extending QML with C++} for details on writing QML C++ +See \l {Writing QML Extensions with C++} for details on writing QML C++ plugins. diff --git a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc index b5dd961ea9..1a539f56ed 100644 --- a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc +++ b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc @@ -193,8 +193,7 @@ To visualize data, bind the view's \c model property to a model and the and \l{qtqml-typesystem-topic.html#qml-object-types} {creating QML types} articles. - The use of positioner items to arrange items from a model is covered in - \l{Generating Items with Repeaters}. + Positioning of items from a model can be achieved using a \l{Repeater}. \section2 ListModel diff --git a/src/quick/doc/src/concepts/modelviewsdata/topic.qdoc b/src/quick/doc/src/concepts/modelviewsdata/topic.qdoc index 6939c3131f..21c81f47e5 100644 --- a/src/quick/doc/src/concepts/modelviewsdata/topic.qdoc +++ b/src/quick/doc/src/concepts/modelviewsdata/topic.qdoc @@ -49,7 +49,7 @@ see the page titled \l{qtquick-modelviewsdata-modelview.html} Databases are commonly used to store information in applications. Qt Quick provides simplified access to relational databases via the -\l{QtQuick.LocalStorage 2}{Qt Quick local storage module}. +\l QtQuick.LocalStorage module. */ diff --git a/src/quick/doc/src/concepts/positioning/righttoleft.qdoc b/src/quick/doc/src/concepts/positioning/righttoleft.qdoc index ad8b2f3b63..5d173efedb 100644 --- a/src/quick/doc/src/concepts/positioning/righttoleft.qdoc +++ b/src/quick/doc/src/concepts/positioning/righttoleft.qdoc @@ -89,7 +89,7 @@ views that takes the mirroring into account can be read from the \c effectiveLay The attached property \l LayoutMirroring is provided as a convenience for easily implementing right-to-left support for existing left-to-right Qt Quick applications. It mirrors the behavior of \l {anchor-layout} -{Item anchors}, the layout direction of \l{Composing User Interfaces with QML#Positioners}{positioners} and +{Item anchors}, the layout direction of \l{Item Positioners}{positioners} and \l{qtquick-modelviewsdata-modelview.html}{model views}, and the explicit text alignment of QML text types. You can enable layout mirroring for a particular \l Item: diff --git a/src/quick/doc/src/concepts/positioning/topic.qdoc b/src/quick/doc/src/concepts/positioning/topic.qdoc index bae6a7f71b..51cb07c51d 100644 --- a/src/quick/doc/src/concepts/positioning/topic.qdoc +++ b/src/quick/doc/src/concepts/positioning/topic.qdoc @@ -51,7 +51,7 @@ the position manually than to use the more dynamic positioning methods documented in proceeding sections. In Qt Quick, every visual object is positioned within the -\l{qtquick-visual-coordinates.html}{coordinate system} +\l{Concepts - Visual Coordinates in Qt Quick}{coordinate system} provided by the Qt Quick visual canvas. As described in that document, the x and y coordinates of a visual object are relative to those of its visual parent, with the top-left corner having the coordinate (0, 0). diff --git a/src/quick/doc/src/concepts/statesanimations/animations.qdoc b/src/quick/doc/src/concepts/statesanimations/animations.qdoc index 07f1048bf2..e4e208863b 100644 --- a/src/quick/doc/src/concepts/statesanimations/animations.qdoc +++ b/src/quick/doc/src/concepts/statesanimations/animations.qdoc @@ -72,7 +72,7 @@ animations provide timing controls and allows different interpolations through \snippet qml/animation.qml property animation -Specialized \l{qml-property-animation-types}{property animation types} +Specialized property animation types have more efficient implementations than the \l{PropertyAnimation} type. They are for setting animations to different QML types such as \c int, \c color, and rotations. Similarly, the \l{ParentAnimation} can animate parent changes. @@ -145,8 +145,7 @@ values. abrupt property changes; animations smooth transitions to produce visually appealing state changes. -The \l{Transition} type can contain -\l{qml-animation-types}{animation types} to interpolate property changes +The \l{Transition} type can contain animation types to interpolate property changes caused by state changes. To assign the transition to an object, bind it to the \c transitions property. diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc index ddca973496..4cb1d8ddd4 100644 --- a/src/quick/doc/src/examples.qdoc +++ b/src/quick/doc/src/examples.qdoc @@ -44,8 +44,8 @@ To run the sample applications, open them in Qt Creator or use the included \annotatedlist{qtquickdemos} -Some of these code samples below have a corresponding \l{qtquick-tutorials}{tutorial}. -The Qt Quick features are covered in the \l {qtquick-overviews}{main page}. +Some of these code samples below have a corresponding tutorial. +The Qt Quick features are covered in the \l {Qt Quick}{main page}. This set of code samples are part of the collection of \l{Qt Examples}. \annotatedlist{qtquickexamples} diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index 0155ee4e2d..dda06d31e1 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -85,7 +85,7 @@ In addition, the \c QtQuick module provides the following basic types: \section1 Object Types All of the object types provided by \c QtQuick are based on the \l{Item} type, -which itself derives from \l{QtQml::QtObject}{QtObject}. \l{qtqml-typereference-topic.html#object-types} +which itself derives from \l{QtQml::QtObject}{QtObject}. \l{Qt QML QML Types#Object Types} {QML object types} provided by the Qt QML module (such as \l{QtQml::QtObject}{QtObject} and \l{QtQml::Component}{Component}) are also available when you import \c QtQuick. @@ -269,7 +269,7 @@ Views \list \li \l {ListView} - Provides a list visualization of a model \li \l {GridView} - Provides a grid visualization of a model -\li \l {PathView} - Visualizes a model's contents along a path. See \l {Path Definition}{Path Elements} for more information. +\li \l {PathView} - Visualizes a model's contents along a path. See \l Path for more information. \li \l {Package} - Collection that enables sharing of items within different views \endlist diff --git a/src/quick/doc/src/tutorial.qdoc b/src/quick/doc/src/tutorial.qdoc index a4428c5818..e0c05b16a8 100644 --- a/src/quick/doc/src/tutorial.qdoc +++ b/src/quick/doc/src/tutorial.qdoc @@ -96,7 +96,7 @@ The \c y property is used to position the text vertically at 30 pixels from the The \c anchors.horizontalCenter property refers to the horizontal center of an type. In this case, we specify that our text type should be horizontally centered in the \e page element (see \l{anchor-layout}{Anchor-Based Layout}). -The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}. +The \c font.pointSize and \c font.bold properties are related to fonts and use the dot notation. \section2 Viewing the example @@ -124,7 +124,7 @@ Our color picker is made of six cells with different colors. To avoid writing the same code multiple times for each cell, we create a new \c Cell component. A component provides a way of defining a new type that we can re-use in other QML files. A QML component is like a black-box and interacts with the outside world through properties, signals and functions and is generally -defined in its own QML file. (For more details, see \l {Defining New Components}). +defined in its own QML file. (For more details, see the \l Component documentation). The component's filename must always start with a capital letter. Here is the QML code for \c Cell.qml: @@ -145,7 +145,7 @@ An \l Item is the most basic visual type in QML and is often used as a container We declare a \c cellColor property. This property is accessible from \e outside our component, this allows us to instantiate the cells with different colors. This property is just an alias to an existing property - the color of the rectangle that compose the cell -(see \l{Property Binding in QML}). +(see \l{Property Binding}). \snippet tutorials/helloworld/Cell.qml 5 diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc index 26d88699bc..16df2a6d0d 100644 --- a/src/quick/doc/src/whatsnew.qdoc +++ b/src/quick/doc/src/whatsnew.qdoc @@ -431,24 +431,23 @@ to \l {Qt Quick}{Qt Quick 2}; the other functions are all new in \l {Qt Quick}{Q \section2 QtQuick.Particles This new module provides particle system support for creating a variety of 2D particle systems. See -the \l{QtQuick.Particles 2}{QtQuick.Particles} documentation for comprehensive details. +the \l QtQuick.Particles documentation for comprehensive details. This obsoletes the experimental \c Qt.labs.particles module. \section2 QtQuick.Window This new module contains the \l Window type for creating a basic window and the \l Screen type for -accessing a screen's resolution and other details. See the \l{QtQuick.Window 2}{QtQuick.Window} +accessing a screen's resolution and other details. See the \l QtQuick.Window documentation for comprehensive details. \section2 QtQuick.XmlListModel This new module contains XmlListModel and associated types, which were previously in the \c QtQuick -module. See the \l{QtQuick.XmlListModel 2}{QtQuick.XmlListModel} documentation for details. +module. See the \l QtQuick.XmlListModel documentation for details. \section2 QtQuick.LocalStorage This new module provides access to the SQL Local Storage API that was previously accessible from the -\l {QML Global Object}. See the \l{QtQuick.LocalStorage 2}{QtQuick.LocalStorage} documentation for details. - +\l {QML Global Object}. See the \l QtQuick.LocalStorage documentation for details. */ diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index be9c592228..763dd5251b 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -845,7 +845,7 @@ void QQuickCanvasItem::requestPaint() canvas renderer will redraw it. This will trigger the onPaint signal handler function. - \sa paint, requestPaint() + \sa onPaint, requestPaint() */ void QQuickCanvasItem::markDirty(const QRectF& rect) diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index b6eb2db33d..b6d4f1073c 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -1103,7 +1103,8 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_scale(QV4::CallContext *ct rotating, and translating transformations in a single step. Each point on the canvas is multiplied by the matrix before anything is - drawn. The \l{HTML5 Canvas API} defines the transformation matrix as: + drawn. The \l{http://www.w3.org/TR/2dcontext/#transformations}{HTML Canvas 2D Context specification} + defines the transformation matrix as: \image qml-item-canvas-math.png where: diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index ed9d1838b8..605c485f6b 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -522,7 +522,7 @@ void QQuickDragAttached::setProposedAction(Qt::DropAction action) \li Drag.Internal (default) - start backwards compatible drags automatically \endlist - When using \l Drag.Automatic you should also define \l mimeData and bind the + When using \c Drag.Automatic you should also define \l mimeData and bind the \active property to the active property of \l MouseArea.drag. */ diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp index 01166ab121..8d58ffbfae 100644 --- a/src/quick/items/qquickdroparea.cpp +++ b/src/quick/items/qquickdroparea.cpp @@ -107,7 +107,7 @@ QQuickDropAreaPrivate::~QQuickDropAreaPrivate() The \l keys property can be used to filter drag events which don't include a matching key. - The \l source property is communicated to the source of a drag event as + The \l drag.source property is communicated to the source of a drag event as the recipient of a drop on the drag target. The \l delegate property provides a means to specify a component to be @@ -337,7 +337,7 @@ void QQuickDropArea::dropEvent(QDropEvent *event) The position of the drag event can be obtained from the \l x and \l y properties, and the \l keys property identifies the drag keys of the event - \l source. + \l {drag.source}{source}. The existence of specific drag types can be determined using the \l hasColor, \l hasHtml, \l hasText, and \l hasUrls properties. @@ -378,7 +378,7 @@ void QQuickDropArea::dropEvent(QDropEvent *event) /*! \qmlproperty enumeration QtQuick::DragEvent::action - This property holds the action that the \l source is to perform on an accepted drop. + This property holds the action that the \l {drag.source}{source} is to perform on an accepted drop. The drop action may be one of: diff --git a/src/quick/items/qquickfocusscope.cpp b/src/quick/items/qquickfocusscope.cpp index f13a8ad3ca..bd8e58af35 100644 --- a/src/quick/items/qquickfocusscope.cpp +++ b/src/quick/items/qquickfocusscope.cpp @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE components. All the details are covered in the \l {Keyboard Focus in Qt Quick}{keyboard focus documentation}. - \sa {declarative/keyinteraction/focus}{Keyboard focus example} + \sa {Qt Quick Examples - Key Interaction} */ QQuickFocusScope::QQuickFocusScope(QQuickItem *parent) : QQuickItem(parent) diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp index 43eb9ff6be..8587da5ac3 100644 --- a/src/quick/items/qquickgridview.cpp +++ b/src/quick/items/qquickgridview.cpp @@ -1787,7 +1787,7 @@ void QQuickGridView::setSnapMode(SnapMode mode) populated, or when the view's \l model changes. (In those cases, the \l populate transition is applied instead.) Additionally, this transition should \e not animate the height of the new item; doing so will cause any items beneath the new item to be laid out at the wrong position. Instead, - the height can be animated within a \l {ListView::onAdd()}{ListView.onAdd} in the delegate. + the height can be animated within a \l {ListView::onAdd}{ListView.onAdd} in the delegate. \sa addDisplaced, populate, ViewTransition */ diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 72b0e588ec..8a11e31b9f 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -1819,7 +1819,7 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus) \value Bottom The center point of the bottom of the item. \value BottomRight The bottom-right corner of the item. - \sa transformOrigin + \sa transformOrigin(), setTransformOrigin() */ /*! @@ -2425,7 +2425,7 @@ void QQuickItem::stackAfter(const QQuickItem *sibling) Returns the window in which this item is rendered. The item does not have a window until it has been assigned into a scene. The - \l windowChanged signal provides a notification both when the item is entered + \l windowChanged() signal provides a notification both when the item is entered into a scene and when it is removed from a scene. */ QQuickWindow *QQuickItem::window() const @@ -4487,7 +4487,7 @@ void QQuickItemPrivate::deliverInputMethodEvent(QInputMethodEvent *e) QQuickItem::itemChange(change, value); \endcode typically at the end of your implementation, to ensure the - \l windowChanged signal will be emitted. + \l windowChanged() signal will be emitted. */ void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value) { diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp index 1d1ea97925..279393b3ba 100644 --- a/src/quick/items/qquickitemanimation.cpp +++ b/src/quick/items/qquickitemanimation.cpp @@ -429,7 +429,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &act When an AnchorAnimation is used in a \l Transition, it will animate any AnchorChanges that have occurred during the state change. This can be overridden by setting a specific target item using the - \l target property. + \l {AnchorChanges::target}{AnchorChanges.target} property. \note AnchorAnimation can only be used in a \l Transition and in conjunction with an AnchorChange. It cannot be used in behaviors and diff --git a/src/quick/items/qquickitemviewtransition.cpp b/src/quick/items/qquickitemviewtransition.cpp index 0940fe0d22..4c09b78329 100644 --- a/src/quick/items/qquickitemviewtransition.cpp +++ b/src/quick/items/qquickitemviewtransition.cpp @@ -901,7 +901,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent) \note The targetIndexes list only contains the indexes of items that are actually in view, or will be in the view once the relevant operation completes. - \sa QtQuick::ViewTransition::targetIndexes + \sa QtQuick::ViewTransition::targetItems */ /*! diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 39fccaa19c..2dd61e386f 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -2485,7 +2485,7 @@ void QQuickListView::setSnapMode(SnapMode mode) populated, or when the view's \l model changes. (In those cases, the \l populate transition is applied instead.) Additionally, this transition should \e not animate the height of the new item; doing so will cause any items beneath the new item to be laid out at the wrong position. Instead, - the height can be animated within a \l {ListView::onAdd()}{ListView.onAdd} in the delegate. + the height can be animated within \l onAdd in the delegate. \sa addDisplaced, populate, ViewTransition */ diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index b83c21428c..debe4b7497 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -271,7 +271,7 @@ qreal QQuickLoaderPrivate::getImplicitHeight() const In some cases you may wish to use a Loader within a view delegate to improve delegate loading performance. This works well in most cases, but there is one important issue to - be aware of related to the \l{QtQuick::Component#creation-context}{creation context} of a Component. + be aware of related to the \l{QtQml::Component#Creation Context}{creation context} of a Component. In the following example, the \c index context property inserted by the ListView into \c delegateComponent's context will be inaccessible to Text, as the Loader will use the creation context of \c myComponent as the parent diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index 48c0f8e084..410f18e767 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -177,8 +177,8 @@ QT_BEGIN_NAMESPACE automatically rotates all content which is displayed, depending on how you hold it. But if orientation changes while primaryOrientation does NOT change, then probably you are using a device which does not rotate its own - display. In that case you may need to use \l Item.rotation or - \l Item.transform to rotate your content. + display. In that case you may need to use \l {Item::rotation}{Item.rotation} or + \l {Item::transform}{Item.transform} to rotate your content. */ /*! \qmlattachedmethod int Screen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 63a3b5d820..b8c180e2fd 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -3317,7 +3317,7 @@ void QQuickWindow::resetOpenGLState() additional content like popups, dialogs, status bars, or similar in relation to the window. - The recommended orientation is \l Screen.orientation, but + The recommended orientation is \l {Screen::orientation}{Screen.orientation}, but an application doesn't have to support all possible orientations, and thus can opt to ignore the current screen orientation. diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index ad9cf06d5c..36316e27c0 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -1461,7 +1461,7 @@ void QQuickVector3dAnimation::setTo(QVector3D t) \snippet qml/rotationanimation.qml 0 - Notice the RotationAnimation did not need to set a \l target + Notice the RotationAnimation did not need to set a \c target value. As a convenience, when used in a transition, RotationAnimation will rotate all properties named "rotation" or "angle". You can override this by providing your own properties via \l {PropertyAnimation::properties}{properties} or |