From 51cf737151c1c446a9ce77832774202b6bdb4ba2 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Thu, 22 Jul 2010 12:42:34 +1000 Subject: Fixed QVideoSurfaceFormat::isValid() Trivial fix, valid formats have pixel format != Invalid, not ==. Task-number: QTBUG-12337 Reviewed-by: Andrew den Exter --- src/multimedia/video/qvideosurfaceformat.cpp | 2 +- .../tst_qvideosurfaceformat.cpp | 27 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp index 1fc13a6..3afbdc9 100644 --- a/src/multimedia/video/qvideosurfaceformat.cpp +++ b/src/multimedia/video/qvideosurfaceformat.cpp @@ -252,7 +252,7 @@ QVideoSurfaceFormat::~QVideoSurfaceFormat() bool QVideoSurfaceFormat::isValid() const { - return d->pixelFormat == QVideoFrame::Format_Invalid && d->frameSize.isValid(); + return d->pixelFormat != QVideoFrame::Format_Invalid && d->frameSize.isValid(); } /*! diff --git a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp index 8a4307e..a4bfb89 100644 --- a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp +++ b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp @@ -127,16 +127,37 @@ void tst_QVideoSurfaceFormat::construct_data() QTest::addColumn("frameSize"); QTest::addColumn("pixelFormat"); QTest::addColumn("handleType"); + QTest::addColumn("valid"); QTest::newRow("32x32 rgb32 no handle") << QSize(32, 32) << QVideoFrame::Format_RGB32 - << QAbstractVideoBuffer::NoHandle; + << QAbstractVideoBuffer::NoHandle + << true; QTest::newRow("1024x768 YUV444 GL texture") << QSize(32, 32) << QVideoFrame::Format_YUV444 - << QAbstractVideoBuffer::GLTextureHandle; + << QAbstractVideoBuffer::GLTextureHandle + << true; + + QTest::newRow("32x32 invalid no handle") + << QSize(32, 32) + << QVideoFrame::Format_Invalid + << QAbstractVideoBuffer::NoHandle + << false; + + QTest::newRow("invalid size, rgb32 no handle") + << QSize() + << QVideoFrame::Format_RGB32 + << QAbstractVideoBuffer::NoHandle + << false; + + QTest::newRow("0x0 rgb32 no handle") + << QSize(0,0) + << QVideoFrame::Format_RGB32 + << QAbstractVideoBuffer::NoHandle + << true; } void tst_QVideoSurfaceFormat::construct() @@ -144,6 +165,7 @@ void tst_QVideoSurfaceFormat::construct() QFETCH(QSize, frameSize); QFETCH(QVideoFrame::PixelFormat, pixelFormat); QFETCH(QAbstractVideoBuffer::HandleType, handleType); + QFETCH(bool, valid); QRect viewport(QPoint(0, 0), frameSize); @@ -154,6 +176,7 @@ void tst_QVideoSurfaceFormat::construct() QCOMPARE(format.frameSize(), frameSize); QCOMPARE(format.frameWidth(), frameSize.width()); QCOMPARE(format.frameHeight(), frameSize.height()); + QCOMPARE(format.isValid(), valid); QCOMPARE(format.viewport(), viewport); QCOMPARE(format.scanLineDirection(), QVideoSurfaceFormat::TopToBottom); QCOMPARE(format.frameRate(), 0.0); -- cgit v0.12 From 5b984faebca64b0542e0221efdee188af22df4bc Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 22 Jul 2010 13:29:02 +0200 Subject: Fix Rhys' qmake warnings --- examples/network/torrent/torrent.pro | 2 +- tests/auto/qnetworkreply/test/test.pro | 2 +- tests/benchmarks/network/network.pro | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro index 7665455..44716fd 100644 --- a/examples/network/torrent/torrent.pro +++ b/examples/network/torrent/torrent.pro @@ -5,7 +5,7 @@ HEADERS += addtorrentdialog.h \ metainfo.h \ peerwireclient.h \ ratecontroller.h \ - filemanager.h \ + filemanager.h \ torrentclient.h \ torrentserver.h \ trackerclient.h diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro index 7bf3852..e63146c 100644 --- a/tests/auto/qnetworkreply/test/test.pro +++ b/tests/auto/qnetworkreply/test/test.pro @@ -31,7 +31,7 @@ symbian:{ DEPLOYMENT += certFiles # Symbian toolchain does not support correct include semantics - INCPATH+=..\..\..\..\include\QtNetwork\private + INCLUDEPATH+=..\..\..\..\include\QtNetwork\private # bigfile test case requires more heap TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" diff --git a/tests/benchmarks/network/network.pro b/tests/benchmarks/network/network.pro index 4e83db2..ea0f821 100644 --- a/tests/benchmarks/network/network.pro +++ b/tests/benchmarks/network/network.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = \ +SUBDIRS = \ access \ kernel \ socket -- cgit v0.12 From 6b6778c7f0e56dc6128b8d6d986cb8874fdf30cd Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 22 Jul 2010 13:33:18 +0200 Subject: One more .pro fix for deprecated INCPATH --- tests/auto/qsocks5socketengine/qsocks5socketengine.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro index 4a32852..5e3c92c 100644 --- a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro +++ b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro @@ -10,7 +10,7 @@ MOC_DIR=tmp QT = core network # Symbian toolchain does not support correct include semantics -symbian:INCPATH+=..\..\..\include\QtNetwork\private +symbian:INCLUDEPATH+=..\..\..\include\QtNetwork\private requires(contains(QT_CONFIG,private_tests)) -- cgit v0.12 From cc3c416682791e1a2fd61d9a473ba3b4715c502d Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 23 Jul 2010 15:16:32 +0100 Subject: Ensure backing store is deleted before top-level window If this is not done, later deletion of the backing store may cause a crash. If the backing store is an EGL surface, its destruction includes a call to eglDestroySurface(), which triggers an exception if the window handle passed as a parameter is no longer valid. Task-number: QTBUG-10643 Task-number: QTBUG-11376 Reviewed-by: Jason Barron --- src/gui/kernel/qapplication_s60.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index f39b462..d5ff792 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -371,6 +371,10 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop) QSymbianControl::~QSymbianControl() { + // Ensure backing store is deleted before the top-level + // window is destroyed + qt_widget_private(qwidget)->topData()->backingStore.destroy(); + if (S60->curWin == this) S60->curWin = 0; if (!QApplicationPrivate::is_app_closing) { -- cgit v0.12 From 3695cb25e4a53921880cfea4d4c731df44fa4396 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 26 Jul 2010 11:53:28 +0100 Subject: Removed QEXPECT_FAIL macros from test cases which now pass Task-number: QTBUG-10643 Task-number: QTBUG-11376 Reviewed-by: Jason Barron --- tests/auto/qwidget/tst_qwidget.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 140356b..2397380 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9681,7 +9681,6 @@ void tst_QWidget::destroyBackingStoreWhenHidden() // Native child widget should once again share parent's backing store QVERIFY(0 != backingStore(parent)); - QEXPECT_FAIL("", "QTBUG-10643", Continue); QVERIFY(0 == backingStore(child)); } @@ -9730,7 +9729,7 @@ void tst_QWidget::destroyBackingStoreWhenHidden() QVERIFY(0 != backingStore(child)); // Parent is obscured, therefore its backing store should be destroyed - QEXPECT_FAIL("", "QTBUG-10643", Continue); + QEXPECT_FAIL("", "QTBUG-12406", Continue); QVERIFY(0 == backingStore(parent)); // Disable full screen @@ -9744,7 +9743,6 @@ void tst_QWidget::destroyBackingStoreWhenHidden() // Native child widget should once again share parent's backing store QVERIFY(0 != backingStore(parent)); - QEXPECT_FAIL("", "QTBUG-10643", Continue); QVERIFY(0 == backingStore(child)); } } -- cgit v0.12 From 3c7e7992461b1fef37ada68244f1b5b891015bda Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 26 Jul 2010 20:51:32 +0200 Subject: Fix crash when all the items in a QListView are hidden Calling QIconModeViewBase::initDynamicLayout() on the second and successive segments would return QPoint(-1,-1), resulting in a totally empty area rectangle for all the items while in QIconModeViewBase::doDynamicLayout(). This rectangle is used to initialize the BSP tree, and produces an arithmetic exception when empty. Furthermore, a rendering bug was also apparent when displaying the first item of a segment while the last item of the previous segment was hidden. Auto-tests included. Reviewed-by: Olivier Task-number: QTBUG-12308 --- src/gui/itemviews/qlistview.cpp | 7 ++++- tests/auto/qlistview/tst_qlistview.cpp | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index b2def39..64ae0db 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -2773,7 +2773,10 @@ QPoint QIconModeViewBase::initDynamicLayout(const QListViewLayoutInfo &info) y = info.bounds.y() + info.spacing; items.reserve(rowCount() - hiddenCount()); } else { - const QListViewItem item = items.at(info.first - 1); + int idx = info.first - 1; + while (idx > 0 && !items.at(idx).isValid()) + --idx; + const QListViewItem &item = items.at(idx); x = item.x; y = item.y; if (info.flow == QListView::LeftToRight) @@ -2899,6 +2902,8 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info) // resize the content area if (done || !info.bounds.contains(item->rect())) contentsSize = QSize(rect.width(), rect.height()); + if (rect.size().isEmpty()) + return; // resize tree int insertFrom = info.first; if (done || info.first == 0) { diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index d2181f8..e5b42ce 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -123,6 +124,8 @@ private slots: void taskQTBUG_435_deselectOnViewportClick(); void taskQTBUG_2678_spacingAndWrappedText(); void taskQTBUG_5877_skippingItemInPageDownUp(); + void taskQTBUG_12308_artihmeticException(); + void taskQTBUG_12308_wrongFlowLayout(); }; // Testing get/set functions @@ -1941,5 +1944,53 @@ void tst_QListView::taskQTBUG_5877_skippingItemInPageDownUp() } } +void tst_QListView::taskQTBUG_12308_artihmeticException() +{ + QListWidget lw; + lw.setLayoutMode(QListView::Batched); + lw.setViewMode(QListView::IconMode); + for (int i = 0; i < lw.batchSize() + 1; i++) { + QListWidgetItem *item = new QListWidgetItem(); + item->setText(QString("Item %L1").arg(i)); + lw.addItem(item); + item->setHidden(true); + } + lw.show(); + QTest::qWaitForWindowShown(&lw); + // No crash, it's all right. +} + +class Delegate12308 : public QStyledItemDelegate +{ + Q_OBJECT +public: + Delegate12308(QObject *parent = 0) : QStyledItemDelegate(parent) + { } + + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const + { + QVERIFY(option.rect.topLeft() != QPoint(-1, -1)); + QStyledItemDelegate::paint(painter, option, index); + } +}; + +void tst_QListView::taskQTBUG_12308_wrongFlowLayout() +{ + QListWidget lw; + Delegate12308 delegate; + lw.setLayoutMode(QListView::Batched); + lw.setViewMode(QListView::IconMode); + lw.setItemDelegate(&delegate); + for (int i = 0; i < lw.batchSize() + 1; i++) { + QListWidgetItem *item = new QListWidgetItem(); + item->setText(QString("Item %L1").arg(i)); + lw.addItem(item); + if (!item->text().contains(QString::fromAscii("1"))) + item->setHidden(true); + } + lw.show(); + QTest::qWaitForWindowShown(&lw); +} + QTEST_MAIN(tst_QListView) #include "tst_qlistview.moc" -- cgit v0.12 From f4f10d2a2d60790939492694abf6b9578a5f048a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 27 Jul 2010 13:55:43 +0200 Subject: Workaround for QTBUG-8013: Do not return an ascent of 0 Symbian's CFont::FontMaxAscent() returns in some cases an incorrect value of 0. That usually happens (for some font sizes) if a stroke based font is the main system font. We were able to reproduce it on some S60 3.2 devices with a chinese language pack installed. This patch will test if CFont::FontMaxAscent() returns 0. And if so, it alculates an ascent taht makes more sense. Task-number: QTBUG-8013 Reviewed-by: Liang Qi --- src/gui/text/qfontengine_s60.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 93f02ff..9073f89 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -291,7 +291,10 @@ glyph_metrics_t QFontEngineS60::boundingBox(glyph_t glyph) QFixed QFontEngineS60::ascent() const { - return m_originalFont->FontMaxAscent(); + // Workaround for QTBUG-8013 + // Stroke based fonts may return an incorrect FontMaxAscent of 0. + const QFixed ascent = m_originalFont->FontMaxAscent(); + return (ascent > 0) ? ascent : QFixed::fromReal(m_originalFontSizeInPixels) - descent(); } QFixed QFontEngineS60::descent() const -- cgit v0.12 From be1e08209a1cef9ff15fc5cc49d4d1d611d917cb Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 27 Jul 2010 13:55:43 +0200 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( d521d7d81e8f0297c94be9ebd8af67ee130d0edb ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2010-07-27 Simon Hausmann Reviewed by Tor Arne Vestbø. [Qt] Incorrect input method hints https://bugs.webkit.org/show_bug.cgi?id=43037 Properly set or reset all input method hints when activating input fields. * WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::setInputMethodState): * tests/qwebview/tst_qwebview.cpp: (tst_QWebView::focusInputTypes): Extended unit test to verify that we reset hints. --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebKit/qt/ChangeLog | 16 +++++++++++++ .../WebKit/qt/WebCoreSupport/EditorClientQt.cpp | 26 ++++++++++------------ .../WebKit/qt/tests/qwebview/tst_qwebview.cpp | 23 ++++++++++++++----- 4 files changed, 47 insertions(+), 20 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index b6178b9..358024b 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 038b62085831eef4dee423361c65ecd55b7b9b1d + d521d7d81e8f0297c94be9ebd8af67ee130d0edb diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index cf335a1..7d419d5 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,19 @@ +2010-07-27 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + [Qt] Incorrect input method hints + https://bugs.webkit.org/show_bug.cgi?id=43037 + + Properly set or reset all input method hints when + activating input fields. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): Extended unit test to verify that we + reset hints. + 2010-06-18 Simon Hausmann Reviewed by Antti Koivisto. diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 3255c8e..cb0758b 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -608,20 +608,18 @@ void EditorClientQt::setInputMethodState(bool active) inputElement = static_cast(frame->document()->focusedNode()); if (inputElement) { - if (!active) { - // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag - // for password fields. The Qt platform is responsible for determining which widget - // will receive input method events for password fields. - active = inputElement->isPasswordField(); - webPageClient->setInputMethodHint(Qt::ImhHiddenText, active); - } else { - // Set input method hints for "number", "tel", "email", and "url" input elements. - webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField()); - webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); - webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); - webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); - webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField()); - } + // Set input method hints for "number", "tel", "email", "url" and "password" input elements. + webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField()); + webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); + webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); + webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); + // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag + // for password fields. The Qt platform is responsible for determining which widget + // will receive input method events for password fields. + bool isPasswordField = inputElement->isPasswordField(); + webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); + if (isPasswordField) + active = true; } #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp index 5e8e8a9..facee59 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -254,23 +254,36 @@ void tst_QWebView::focusInputTypes() // 'password' field webView->fireMouseClick(QPoint(20, 60)); - QVERIFY(webView->inputMethodHints() & Qt::ImhHiddenText); + QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); // 'tel' field webView->fireMouseClick(QPoint(20, 110)); - QVERIFY(webView->inputMethodHints() & Qt::ImhDialableCharactersOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhDialableCharactersOnly); // 'number' field webView->fireMouseClick(QPoint(20, 160)); - QVERIFY(webView->inputMethodHints() & Qt::ImhDigitsOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhDigitsOnly); // 'email' field webView->fireMouseClick(QPoint(20, 210)); - QVERIFY(webView->inputMethodHints() & Qt::ImhEmailCharactersOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhEmailCharactersOnly); // 'url' field webView->fireMouseClick(QPoint(20, 260)); - QVERIFY(webView->inputMethodHints() & Qt::ImhUrlCharactersOnly); + QVERIFY(webView->inputMethodHints() == Qt::ImhUrlCharactersOnly); + + // 'password' field + webView->fireMouseClick(QPoint(20, 60)); + QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); + + // 'text' type + webView->fireMouseClick(QPoint(20, 10)); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + QVERIFY(webView->inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView->inputMethodHints() & Qt::ImhNoPredictiveText); +#else + QVERIFY(webView->inputMethodHints() == Qt::ImhNone); +#endif delete webView; -- cgit v0.12