diff options
author | Liang Qi <liang.qi@qt.io> | 2019-02-01 14:31:31 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-02-01 14:50:06 +0100 |
commit | 4b0a030cc9b9fa32383a43e2b971f05a536b8e7f (patch) | |
tree | ac4738a7ae6ff491c3afa3171b27c9688635e58a /src | |
parent | e09519bad7ff266e466ea2d2d66187fbb13457f9 (diff) | |
parent | 5d8d0d7068bc8498ea2a6a4c9bc16e0eeb92836c (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
src/qml/compiler/qv4codegen.cpp
Done-With: Erik Verbruggen <erik.verbruggen@qt.io>
Change-Id: I3ae3d64317e4f3fccba6605f4c6da15479ca75e0
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/settings/plugin.cpp | 2 | ||||
-rw-r--r-- | src/imports/settings/plugins.qmltypes | 3 | ||||
-rw-r--r-- | src/imports/settings/qqmlsettings.cpp | 12 | ||||
-rw-r--r-- | src/imports/settings/qqmlsettings_p.h | 6 | ||||
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 11 | ||||
-rw-r--r-- | src/qml/doc/src/cppintegration/definetypes.qdoc | 2 | ||||
-rw-r--r-- | src/quick/handlers/qquicktaphandler.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickevents.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 6 | ||||
-rw-r--r-- | src/quick/items/qquicktextinput_p_p.h | 5 |
10 files changed, 27 insertions, 24 deletions
diff --git a/src/imports/settings/plugin.cpp b/src/imports/settings/plugin.cpp index 3ac0ad4653..eb7d5027a4 100644 --- a/src/imports/settings/plugin.cpp +++ b/src/imports/settings/plugin.cpp @@ -55,7 +55,7 @@ public: { Q_ASSERT(QByteArray(uri) == QByteArray("Qt.labs.settings")); qmlRegisterType<QQmlSettings>(uri, 1, 0, "Settings"); - qmlRegisterType<QQmlSettings,1>(uri, 1, 1, "Settings"); + qmlRegisterModule(uri, 1, 1); // QTBUG-73239 } }; diff --git a/src/imports/settings/plugins.qmltypes b/src/imports/settings/plugins.qmltypes index 1d69fcf7e9..3c9685fe10 100644 --- a/src/imports/settings/plugins.qmltypes +++ b/src/imports/settings/plugins.qmltypes @@ -20,20 +20,17 @@ Module { Property { name: "fileName"; revision: 1; type: "string" } Method { name: "value" - revision: 1 type: "QVariant" Parameter { name: "key"; type: "string" } Parameter { name: "defaultValue"; type: "QVariant" } } Method { name: "value" - revision: 1 type: "QVariant" Parameter { name: "key"; type: "string" } } Method { name: "setValue" - revision: 1 Parameter { name: "key"; type: "string" } Parameter { name: "value"; type: "QVariant" } } diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp index 310ef62d9f..f7a7d8b055 100644 --- a/src/imports/settings/qqmlsettings.cpp +++ b/src/imports/settings/qqmlsettings.cpp @@ -433,9 +433,9 @@ void QQmlSettings::setCategory(const QString &category) This property holds the path to the settings file. If the file doesn't already exist, it is created. - \sa QSettings::fileName, QSettings::IniFormat + \since Qt 5.12 - \since Qt.labs.settings 1.1 + \sa QSettings::fileName, QSettings::IniFormat */ QString QQmlSettings::fileName() const { @@ -460,9 +460,9 @@ void QQmlSettings::setFileName(const QString &fileName) Returns the value for setting \a key. If the setting doesn't exist, returns \a defaultValue. - \sa QSettings::value + \since Qt 5.12 - \since Qt.labs.settings 1.1 + \sa QSettings::value */ QVariant QQmlSettings::value(const QString &key, const QVariant &defaultValue) const { @@ -476,9 +476,9 @@ QVariant QQmlSettings::value(const QString &key, const QVariant &defaultValue) c Sets the value of setting key to value. If the key already exists, the previous value is overwritten. - \sa QSettings::setValue + \since Qt 5.12 - \since Qt.labs.settings 1.1 + \sa QSettings::setValue */ void QQmlSettings::setValue(const QString &key, const QVariant &value) { diff --git a/src/imports/settings/qqmlsettings_p.h b/src/imports/settings/qqmlsettings_p.h index f73e595557..f9122a58f7 100644 --- a/src/imports/settings/qqmlsettings_p.h +++ b/src/imports/settings/qqmlsettings_p.h @@ -65,7 +65,7 @@ class QQmlSettings : public QObject, public QQmlParserStatus Q_OBJECT Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(QString category READ category WRITE setCategory FINAL) - Q_PROPERTY(QString fileName READ fileName WRITE setFileName FINAL REVISION 1) + Q_PROPERTY(QString fileName READ fileName WRITE setFileName FINAL) public: explicit QQmlSettings(QObject *parent = 0); @@ -77,8 +77,8 @@ public: QString fileName() const; void setFileName(const QString &fileName); - Q_REVISION(1) Q_INVOKABLE QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; - Q_REVISION(1) Q_INVOKABLE void setValue(const QString &key, const QVariant &value); + Q_INVOKABLE QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; + Q_INVOKABLE void setValue(const QString &key, const QVariant &value); protected: void timerEvent(QTimerEvent *event) override; diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 7aa848f6e9..a0a2a17b0f 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -3341,7 +3341,6 @@ bool Codegen::visit(ForEachStatement *ast) BytecodeGenerator::Label in = bytecodeGenerator->newLabel(); BytecodeGenerator::Label end = bytecodeGenerator->newLabel(); - BytecodeGenerator::Label done = bytecodeGenerator->newLabel(); { auto cleanup = [ast, iterator, iteratorDone, this]() { @@ -3360,7 +3359,7 @@ bool Codegen::visit(ForEachStatement *ast) next.value = lhsValue.stackSlot(); next.done = iteratorDone.stackSlot(); bytecodeGenerator->addInstruction(next); - bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpTrue()).link(done); + bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpTrue()).link(end); // each iteration gets it's own context, as per spec { @@ -3401,11 +3400,10 @@ bool Codegen::visit(ForEachStatement *ast) error: end.link(); - // ~ControlFlowLoop will be called here, which will generate unwind code when needed + // all execution paths need to end up here (normal loop exit, break, and exceptions) in + // order to reset the unwind handler, and to close the iterator in calse of an for-of loop. } - done.link(); - return false; } @@ -3664,15 +3662,12 @@ void Codegen::handleTryCatch(TryStatement *ast) { Q_ASSERT(ast); RegisterScope scope(this); - BytecodeGenerator::Label noException = bytecodeGenerator->newLabel(); { ControlFlowCatch catchFlow(this, ast->catchExpression); RegisterScope scope(this); TailCallBlocker blockTailCalls(this); // IMPORTANT: destruction will unblock tail calls before catch is generated statement(ast->statement); - bytecodeGenerator->jump().link(noException); } - noException.link(); } void Codegen::handleTryFinally(TryStatement *ast) diff --git a/src/qml/doc/src/cppintegration/definetypes.qdoc b/src/qml/doc/src/cppintegration/definetypes.qdoc index 7f3ff416a1..0cce1895cb 100644 --- a/src/qml/doc/src/cppintegration/definetypes.qdoc +++ b/src/qml/doc/src/cppintegration/definetypes.qdoc @@ -691,7 +691,7 @@ public: QQmlListProperty<Message> messages(); private: - QList<Message *> messages; + QList<Message *> m_messages; }; \endcode diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index 475942b7ac..b4b6bd574e 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -130,7 +130,7 @@ bool QQuickTapHandler::wantsEventPoint(QQuickEventPoint *point) case QQuickEventPoint::Updated: switch (m_gesturePolicy) { case DragThreshold: - ret = !overThreshold; + ret = !overThreshold && parentContains(point); break; case WithinBounds: ret = parentContains(point); diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 31c56b7cb7..2eaab164a0 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -851,7 +851,7 @@ void QQuickEventPoint::setGrabberItem(QQuickItem *grabber) if (oldGrabberHandler && !oldGrabberHandler->approveGrabTransition(this, grabber)) return; if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { - qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) + qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) << "@" << m_scenePos << ": grab" << m_exclusiveGrabber << "->" << grabber; } QQuickItem *oldGrabberItem = grabberItem(); diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index a52cd81ef3..5f6fd8f50f 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -1242,6 +1242,12 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo) d->updateDisplayText(); updateCursorRectangle(); + // If this control is used for password input, we want to minimize + // the possibility of string reallocation not to leak (parts of) + // the password. + if (d->m_echoMode != QQuickTextInput::Normal) + d->m_text.reserve(30); + emit echoModeChanged(echoMode()); } diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h index a2e2f0f66d..7965f3d3f4 100644 --- a/src/quick/items/qquicktextinput_p_p.h +++ b/src/quick/items/qquicktextinput_p_p.h @@ -162,6 +162,11 @@ public: ~QQuickTextInputPrivate() { + // If this control is used for password input, we don't want the + // password data to stay in the process memory, therefore we need + // to zero it out + if (m_echoMode != QQuickTextInput::Normal) + m_text.fill(0); } void init(); |