summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-11-25 13:32:37 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-11-25 13:32:37 (GMT)
commit850ebb63dfe5fbfdb2107d33a1af4460da59b97c (patch)
tree5e0350e3180de97b561be16072ff1444499048d3 /src/3rdparty
parente868e896054061f35b38dd3e7b688d932be40a55 (diff)
parent5200f708c46d4bc737d6706691965c726c063292 (diff)
downloadQt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.zip
Qt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.tar.gz
Qt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: qmake/generators/symbian/symmake.cpp src/corelib/global/qglobal.h src/gui/kernel/qwidget_p.h src/gui/painting/qtextureglyphcache.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h src/plugins/qpluginbase.pri src/qbase.pri tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp tests/auto/qthread/tst_qthread.cpp tests/auto/selftests/expected_cmptest.txt tests/auto/selftests/expected_crashes_3.txt tests/auto/selftests/expected_longstring.txt tests/auto/selftests/expected_maxwarnings.txt tests/auto/selftests/expected_skip.txt tools/assistant/tools/assistant/doc/assistant.qdocconf tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qdeclarative.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf tools/qdoc3/test/qt.qdocconf tools/qdoc3/test/qt_ja_JP.qdocconf tools/qdoc3/test/qt_zh_CN.qdocconf
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp38
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview_p.h2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp14
5 files changed, 49 insertions, 19 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 9b97c8b..5bb3c57 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1351,26 +1351,30 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
}
}
- if (!ev->commitString().isEmpty())
+ if (renderTextControl && ev->replacementLength() > 0) {
+ renderTextControl->setSelectionStart(qMax(renderTextControl->selectionStart() + ev->replacementStart(), 0));
+ renderTextControl->setSelectionEnd(qMin(renderTextControl->selectionStart() + ev->replacementLength(), static_cast<int>(renderTextControl->text().length())));
+ // Commit regardless of whether commitString is empty, to get rid of selection.
editor->confirmComposition(ev->commitString());
- else {
- // 1. empty preedit with a selection attribute, and start/end of 0 cancels composition
- // 2. empty preedit with a selection attribute, and start/end of non-0 updates selection of current preedit text
- // 3. populated preedit with a selection attribute, and start/end of 0 or non-0 updates selection of supplied preedit text
- // 4. otherwise event is updating supplied pre-edit text
- QString preedit = ev->preeditString();
+ } else if (!ev->commitString().isEmpty()) {
+ editor->confirmComposition(ev->commitString());
+ }
+ // 1. empty preedit with a selection attribute, and start/end of 0 cancels composition
+ // 2. empty preedit with a selection attribute, and start/end of non-0 updates selection of current preedit text
+ // 3. populated preedit with a selection attribute, and start/end of 0 or non-0 updates selection of supplied preedit text
+ // 4. otherwise event is updating supplied pre-edit text
+ QString preedit = ev->preeditString();
#if QT_VERSION >= 0x040600
- if (hasSelection) {
- QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString();
- if (preedit.isEmpty() && selection.start + selection.length > 0)
- preedit = text;
- editor->setComposition(preedit, underlines,
- (selection.length < 0) ? selection.start + selection.length : selection.start,
- (selection.length < 0) ? selection.start : selection.start + selection.length);
- } else
+ if (hasSelection) {
+ QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString();
+ if (preedit.isEmpty() && selection.start + selection.length > 0)
+ preedit = text;
+ editor->setComposition(preedit, underlines,
+ (selection.length < 0) ? selection.start + selection.length : selection.start,
+ (selection.length < 0) ? selection.start : selection.start + selection.length);
+ } else
#endif
- editor->setComposition(preedit, underlines, preedit.length(), 0);
- }
+ editor->setComposition(preedit, underlines, preedit.length(), 0);
ev->accept();
}
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
index e4f70de..7a8aae7 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -141,6 +141,16 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
QGraphicsWebView::mouseMoveEvent(event);
}
+bool GraphicsWebView::sceneEvent(QEvent *event)
+{
+ bool rv = QGraphicsWebView::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ pressTimer.stop();
+ parent->setKeepMouseGrab(false);
+ }
+ return rv;
+}
+
/*!
\qmlclass WebView QDeclarativeWebView
\ingroup qml-view-elements
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview_p.h b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview_p.h
index b2055bf..ca15a1e 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview_p.h
@@ -70,6 +70,8 @@ protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void timerEvent(QTimerEvent* event);
+ bool sceneEvent(QEvent *event);
+
Q_SIGNALS:
void doubleClick(int clickX, int clickY);
private:
diff --git a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
index f2282f8..b98617f 100644
--- a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
+++ b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
@@ -1,5 +1,5 @@
-QT_WEBKIT_VERSION = 4.7.1
+QT_WEBKIT_VERSION = 4.7.2
QT_WEBKIT_MAJOR_VERSION = 4
QT_WEBKIT_MINOR_VERSION = 7
-QT_WEBKIT_PATCH_VERSION = 1
+QT_WEBKIT_PATCH_VERSION = 2
QT_CONFIG += webkit
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index b7ffb8a..31cf277 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -1502,6 +1502,20 @@ void tst_QWebPage::inputMethods()
QCOMPARE(value, QString("QtWebKit"));
#endif
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event(QString(), attributes);
+ event.setCommitString("XXX", 0, 0);
+ page->event(&event);
+ event.setCommitString(QString(), -2, 2); // Erase two characters.
+ page->event(&event);
+ event.setCommitString(QString(), -1, 1); // Erase one character.
+ page->event(&event);
+ variant = page->inputMethodQuery(Qt::ImSurroundingText);
+ value = variant.value<QString>();
+ QCOMPARE(value, QString("QtWebKit"));
+ }
+
// Cancel current composition first
inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
QInputMethodEvent eventSelection4("", inputAttributes);