From bb11b53bedb8e239b9439b4a3fc3320e35c2de57 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Mon, 20 Jun 2011 12:18:57 +1000 Subject: Scroll correctly when cursorPosition is changed within onTextChanged. Emit textChanged() before adjusting size and scroll positions otherwise the calculations will be based on the cursor position before it's moved in handler and because the cursor position won't ultimately have changed there won't be a follow up cursorPositionChanged() signal to trigger a second set of calculation. Change-Id: I1af7cf320baf984388d90562233c5686dcf44d20 Task-number: QTBUG-19912 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 0d10bb6..21e3ad3 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1940,12 +1940,12 @@ void QDeclarativeTextInput::selectionChanged() void QDeclarativeTextInput::q_textChanged() { Q_D(QDeclarativeTextInput); + emit textChanged(); + emit displayTextChanged(); updateSize(); d->determineHorizontalAlignment(); d->updateHorizontalScroll(); updateMicroFocus(); - emit textChanged(); - emit displayTextChanged(); if(hasAcceptableInput() != d->oldValidity){ d->oldValidity = hasAcceptableInput(); emit acceptableInputChanged(); -- cgit v0.12 From a95814e170643d67a682482b08f574e0f1e9fbf1 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 21 Jun 2011 12:18:49 +1000 Subject: Fix crash in PropertyChanges. Don't crash when adding an optimized binding to an object not associated with a QDeclarativeEngine. Change-Id: I4501e21e959380fedfafdc8bc477b330cffbce1b Task-number: QTBUG-19914 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativebinding.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index a5bd604..56361da 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -243,12 +243,13 @@ QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeCont if (id < 0) return 0; + Q_ASSERT(ctxt); QDeclarativeContextData *ctxtdata = QDeclarativeContextData::get(ctxt); - QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(qmlEngine(obj)); + QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(ctxtdata->engine); QDeclarativeCompiledData *cdata = 0; QDeclarativeTypeData *typeData = 0; - if (engine && ctxtdata && !ctxtdata->url.isEmpty()) { + if (!ctxtdata->url.isEmpty()) { typeData = engine->typeLoader.get(ctxtdata->url); cdata = typeData->compiledData(); } -- cgit v0.12