summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-29 19:59:03 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-29 19:59:03 (GMT)
commit91119eaa185934d568d0c83e25129b0028b5a607 (patch)
tree89f350ae6614aa0d76c3ecc4f114bddde45b05c8
parent12e5d8897fbd60def1dd38608c1cd3f0d1d4317b (diff)
parente62f0aec863147682fcfcb651d13e0e7cff6d363 (diff)
downloadQt-91119eaa185934d568d0c83e25129b0028b5a607.zip
Qt-91119eaa185934d568d0c83e25129b0028b5a607.tar.gz
Qt-91119eaa185934d568d0c83e25129b0028b5a607.tar.bz2
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( d521d7d81e8f0297c94be9ebd8af67ee130d0edb ) Workaround for QTBUG-8013: Do not return an ascent of 0 Fix crash when all the items in a QListView are hidden Removed QEXPECT_FAIL macros from test cases which now pass Ensure backing store is deleted before top-level window One more .pro fix for deprecated INCPATH Fix Rhys' qmake warnings Fixed QVideoSurfaceFormat::isValid()
-rw-r--r--examples/network/torrent/torrent.pro2
-rw-r--r--src/gui/itemviews/qlistview.cpp7
-rw-r--r--src/gui/text/qfontengine_s60.cpp5
-rw-r--r--src/multimedia/video/qvideosurfaceformat.cpp2
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp51
-rw-r--r--tests/auto/qnetworkreply/test/test.pro2
-rw-r--r--tests/auto/qsocks5socketengine/qsocks5socketengine.pro2
-rw-r--r--tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp27
-rw-r--r--tests/benchmarks/network/network.pro2
9 files changed, 91 insertions, 9 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/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 1869093..76d7642 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2782,7 +2782,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)
@@ -2913,6 +2916,8 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info)
else
contentsSize.rwidth() += info.spacing;
}
+ if (rect.size().isEmpty())
+ return;
// resize tree
int insertFrom = info.first;
if (done || info.first == 0) {
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index 74ef646..52a1fe7 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -374,7 +374,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
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/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index 5112ee0..425ac89 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -45,6 +45,7 @@
#include <qabstractitemmodel.h>
#include <qapplication.h>
#include <qlistview.h>
+#include <qlistwidget.h>
#include <qitemdelegate.h>
#include <qstandarditemmodel.h>
#include <qstringlistmodel.h>
@@ -125,6 +126,8 @@ private slots:
void taskQTBUG_5877_skippingItemInPageDownUp();
void taskQTBUG_9455_wrongScrollbarRanges();
void styleOptionViewItem();
+ void taskQTBUG_12308_artihmeticException();
+ void taskQTBUG_12308_wrongFlowLayout();
};
// Testing get/set functions
@@ -2002,5 +2005,53 @@ void tst_QListView::styleOptionViewItem()
QApplication::processEvents();
}
+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"
diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro
index b9ece38..6e1b1e3 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/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
index 62c0c87..171d428 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
symbian: TARGET.CAPABILITY = NetworkServices
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<QSize>("frameSize");
QTest::addColumn<QVideoFrame::PixelFormat>("pixelFormat");
QTest::addColumn<QAbstractVideoBuffer::HandleType>("handleType");
+ QTest::addColumn<bool>("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);
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